-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fix encore advanced config watchOptions example #10923
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
Conversation
@eXtreme thanks for contributing this. Sadly, I can't reproduce this error. If I add the This is what I did: I added So, can you please double check if this works for you too? Thanks! |
@javiereguiluz when I just dump the config in the var config = Encore.getWebpackConfig();
console.log(config); the output is:
and Isn't this because I use the dev server? https://symfony.com/doc/current/frontend/encore/dev-server.html If so, maybe we should change the docs and add two versions of this snippet, one for "using webpack-dev-server" and one for not using it. |
Hi there, @eXtreme Indeed, if you use the dev server ( That being said there is a pending PR on Encore that should help setting those parameters correctly by introducing an |
Hi @Lyrkan that indeed looks like a better approach. |
This PR was merged into the 3.4 branch. Discussion ---------- Fix encore advanced config watchOptions example I've been struggling with this for some time and couldn't get `watchOptions` to work. After a long investigation I added `devServer` to the config and it started working. So I guess this is the correct example of adding watchOptions to the config. Commits ------- 06f5c23 Fix encore advanced config watchOptions example
@javiereguiluz that sounds reasonable at this moment, thanks! |
Hi @javiereguiluz, I've just seen your comment about updating some code when symfony/webpack-encore#486 will be merged and Since we don't need to use // if you run 'encore dev --watch'
config.watchOptions = { poll: true, ignored: /node_modules/ };
// if you run 'encore dev-server'
config.devServer.watchOptions = { poll: true, ignored: /node_modules/ }; And of course document Thanks |
I've been struggling with this for some time and couldn't get
watchOptions
to work. After a long investigation I addeddevServer
to the config and it started working.So I guess this is the correct example of adding watchOptions to the config.