webpack: webpack watch mode not working....
General Information: webpack version: 1.13.2 OS: Windows 10 Anniversary Update and webpack is running in Windows Subsystem for Linux(The new bash on Ubuntu)
I"m trying to run webpack in watch mode by using:
webpack --watch
and by also setting watch mode in config:
context: path.join(__dirname, '/src'),
devtool: debug ? 'inline-sourcemap' : null,
entry: './js-src/scripts.js',
watch: true,
module: {
All webpack does is run the transpiler and exit.
Example of output when running watch mode:
Hash: 045070ba2ed9ce40edf7
Version: webpack 1.13.2
Time: 2146ms
Asset Size Chunks Chunk Names
scripts.min.js 1.89 MB 0 [emitted] main
+ 172 hidden modules
I’m not sure what i’m doing incorrect?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 17
- Comments: 37 (7 by maintainers)
Try this workaround:
Add this to your webpack configuration file:
For googlers, On wsl 2 you have to set poll,
poll: 1000
worked for me.I have similar problem on Linux Mint 18.2. After fix inotify issue works fun 😃
watchOptions: { poll: true }
Thank you. This solution works for me.
Nevermind… The problem was the
!
in the directory name 😕I am on webpack 3, and I have poll option enabled, still Webpack picks up first few writes and then doesn’t do that. I have tried saving the files via emacs and atom.
@mastercactapus I would be glad to help you (i’ve created chokidar). Are you able to set up a demo git repo that makes it easy to replicate the issue?
@lahdo Thank you so much. It works. Here is part of my Webpack setting.
I had this problem, just updated webpack-cli from 4.0.0 to 4.1.0 and it fixed it!
@zatloeri Please create reproducible test repo and open an issue in webpack-cli