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

Only works if not alone in plugins list #34

Open
OoDeLally opened this issue Jan 30, 2019 · 5 comments
Open

Only works if not alone in plugins list #34

OoDeLally opened this issue Jan 30, 2019 · 5 comments

Comments

@OoDeLally
Copy link

I made a dummy project, to get the simplest situation where the problem occurs:

ExtraWatchWebpackPlugin_bug.zip

If you run npm run build, it will watch index.js, as it is the entry point, but it will not watch extra.js.

However, if you uncomment the webpack.BannerPlugin plugin in webpack.config.js, now it successfully watch extra.js.

I can't explain this behavior. I added some console logs in ExtraWatchWebpackPlugin, and it seems like it always reacts when extra.js is modified, but the output file is not rebuilt.

Any help appreciated!

@soda-x
Copy link
Owner

soda-x commented Jan 31, 2019

In fact, it doesn't work in either situation.

But it works well by using webpack-dev-server to debug this demo.

I debugged ExtraWatchWebpackPlugin it seems everything is ok, I'm not sure where the issue comes from right now. An additional parameter may be required when you using webpack-cli watch mode directly.

I'm so sorry for this issue, I need some time to do more debugging.

@OoDeLally
Copy link
Author

OoDeLally commented Jan 31, 2019

Hey @pigcan, thank you for the quick reply!
I am not sure it comes from your package, because the very same problem occurs with webpack-watch-files-plugin (your "competitor").
How did you use webpack-dev-server exactly? I tried adding it on top of extra-watch-webpack-plugin but it doesnt seem to do anything either.

@soda-x
Copy link
Owner

soda-x commented Jan 31, 2019

package.json

{
  "scripts": {
    "start": "webpack-dev-server"
  },
  "dependencies": {
    "webpack-dev-server": "*"
  }
}

@OoDeLally
Copy link
Author

OoDeLally commented Jan 31, 2019

I see, I am not familiar with webpack-dev-server, and didn't realize I had to call it instead of classic npx webpack.
Yeah it definitely works fine with it.
Is it possible that your plugin relies on a feature that is provided/expoited by other plugins as well as webpack-dev-server, but not from/by vanilla webpack?

@soda-x
Copy link
Owner

soda-x commented Jan 31, 2019

The plugin relies on webpack definitely.

https://github.com/pigcan/extra-watch-webpack-plugin/blob/master/src/index.js#L63
https://github.com/pigcan/extra-watch-webpack-plugin/blob/master/src/index.js#L68

But I am not sure why it can't be worked. Later I will work on it.

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

2 participants