Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add custom webpack config options? #854

Closed
liuzhen2008 opened this issue Jun 2, 2017 · 4 comments
Closed

How to add custom webpack config options? #854

liuzhen2008 opened this issue Jun 2, 2017 · 4 comments

Comments

@liuzhen2008
Copy link

liuzhen2008 commented Jun 2, 2017

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
Copy link
Contributor

ankurk91 commented Jun 3, 2017

https://github.com/JeffreyWay/laravel-mix/blob/master/docs/quick-webpack-configuration.md

@liuzhen2008
Copy link
Author

@ankurk91 Thanks. This is exactly what i was looking for.

@benyanke
Copy link

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.

@liuzhen2008
Copy link
Author

liuzhen2008 commented Aug 17, 2017

@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/
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants