I am using laravel mix, but i also want to add some extra custom webpack config options
How do I go about adding it?
watchOptions: {
aggregateTimeout: 2000,
poll: 2000,
ignored: /node_modules/
}
This is the watch options I would like to add. But i don't quite understand how to modify the packaged webpack.config.js.
I can obviously fork it and use that version, but how do I simply extend it?
@ankurk91 Thanks. This is exactly what i was looking for.
Could you share your final config file, with these watch options implemented. @liuzhen2008 ? I'm having trouble getting this working, and trying to do the exact same as you.
@benyanke Hey. I think I did was
const { mix } = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
mix.webpackConfig({
watchOptions: {
aggregateTimeout: 2000,
poll: 2000,
ignored: /node_modules/
}
});
Most helpful comment
https://github.com/JeffreyWay/laravel-mix/blob/master/docs/quick-webpack-configuration.md