Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webpack --watch does not work nor webpack-dev-server

This is starting to drive me a bit crazy. I'm spending way too much time trying to get webpack to work and watch and hot load my files. I've looked at several links and tried their solutions but it does not fix the problem. I'm wondering if it has to do with my setup and permissions more than webpack itself so thought I'd bite the bullet and post here in case anyone else has the same setup:

I'm running a live session of Ubuntu 14.04 off an 8GB usb key, and saving my app files in a "src" folder inside the Documents folder. I'm using Atom editor as the IDE.

When I navigate into the src folder and run the "webpack --watch ./app.js bundle.js" or "webpack-dev-server --inline --hot" they both run and give me good messages such as "webpack: build is now VALID" but when I edit my js in Atom and save it does not automatically recompile either on the browser page or terminal. It gives no errors. It just doesn't do anything.

I tried deleting and renaming/recreating/moving the src folder, and checking for case but nothing changes. It compiles correctly when I go to http://localhost:8080 just no recompiling.

For anyone else laboring through this here are the 2 most helpful links that should solve most problems like this and I've also included a very helpful webpack youtube video I've been using. They just aren't working in this particular case.

webpack --watch isn't compiling changed files

Why is webpack --watch not updating when specific files are updated

Youtube video: Introduction to Webpack with Jeremy Lund. Even with the bare minimum js files and webpack.config.js as shown in this example I can't get --watch to run. https://www.youtube.com/watch?v=RKqRj3VgR_c


Edit:

I opened up my src folder while webpack-dev-server was running in the console and manually edited my app.js file using ubuntu's default text editor instead of Atom. When I saved the file webpack did recompile and bundle the files automatically and refreshed the browser. It seems like the problem might be Atom? I'm new to this.

like image 425
Mark McCormack Avatar asked Oct 19 '22 05:10

Mark McCormack


1 Answers

Win7, PhpStorm, Virtualbox: Ubuntu 14.04

I stuck the same problem. Solution has been found: webpack --watch isn't compiling changed files

Run: webpack --watch --watch-poll Of course remove 'watch: true' from webpack config before it.

like image 102
ZloyPotroh Avatar answered Oct 21 '22 19:10

ZloyPotroh