1

After I run composer require zurb/foundation how do I reference the foundation file in my vendor directory @import foundation always says that the file is not found and it doesn't look like laravel mix has the option to includePaths like elixir did in previous versions.

Almost everything I see online installs foundation with npm is that the preferred way? I have nothing against using npm but when I run "npm run production" it fails due to string literals "`" because uglifyJs does not support ES6. I am trying the composer version because I believe that it already has the js compiled so I wont have to do anything hacky to get that to run in production.

1

2 Answers 2

1

I was able to find the answer to this problem myself. You have to copy the foundation files to the appropriate resources/assets folder and then reference them from there. I set the third parameter to false because by default it collapses the files.

.copy('vendor/zurb/foundation/js', 'resources/assets/js/foundation', false) .copy('vendor/zurb/foundation', 'resources/assets/sass/foundation', false)

Then reference the foundation files like so for scss: @import ./foundation/scss/foundation;

Sign up to request clarification or add additional context in comments.

Comments

0

I was actually able to get foundation working with the npm package. By adding the webpackConfig it excludes the foundation folder from being uglified in production.

if (mix.inProduction()) { mix.webpackConfig({ output: { chunkFilename: 'js/chunk-[id]-[chunkhash].js' }, module: { rules: [{ test: /\.jsx?$/, exclude: /node_modules(?!\/foundation-sites)|bower_components/, use: [{ loader: 'babel-loader', options: Config.babel() }] }] } }); } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.