P
P
Peter2016-01-18 22:46:50
webpack
Peter, 2016-01-18 22:46:50

Why doesn't webpack --watch work?

Under Windows, I run webpack --watch , the assembly takes place, but there is no monitoring for changes.
Sources here https://github.com/volkovpv/webpack-not-watch
Why is this happening and how to fix it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Loginov-Solonitsyn, 2016-07-19
@kasheibess

I see the question is already a long-standing one .. maybe the author himself found the answer and just didn’t write here?
I found only that if you are on a Windows, then this problem is common.
For the second day I have been trying to somehow solve this problem and everything seems to be going to a successful finale .
At first I thought that I was writing something wrong, after all, I use webpack for the first time. I cloned several repositories for myself, the result is the same. Watcher starts successfully, but file changes do not provoke a rebuild of the project. Although for the same Ilya Kantor everything works fine on a poppy .
One idea came to mind - running webpack via gulp plugin. Gulp is going with a bang. And the watcher does not freeze there.
All the same, webpack is a new tool for me, and therefore I will do it according to the last video from the gulp screencast, again from Ilya Kantor
. And it really works for me. What's wrong, I frankly don't understand. Separately, webpack does not monitor files, but in conjunction with gulp everything works fine.
As an example, I bitbucketed that minimalistic project that I got by crossing the beginning of the screencast about webpack (there I got to what seems to be the third video) and the most recent video from the screencast on gulp .
This is how I discovered America.
I myself still have a hard time understanding this, so do not kick much)
Thank you!

P
Pianist, 2016-09-06
@kzakhariy

I also follow the Webpack lessons from the cantor.
watch didn't work like this:

module.exports = {
    context: __dirname + '/frontend',
    entry: {
        home: './home',
        about: './about'
        //header: './header'
    },

And this is how it worked:
var path = require("path");
module.exports = {
    //context: path.resolve(__dirname, "frontend") ,
    entry: {
        home: path.resolve(__dirname, "frontend",'home'),
        about: path.resolve(__dirname, "frontend",'about')
        //header: './header'
    },
    ....

The problem is described here - https://webpack.github.io/docs/troubleshooting.htm...
I don't understand how to write in context then

I
IPri, 2016-09-30
@IPri

Ran your example, tracking works ( Webpack 1.13.2 ).
webpack.config.js :

module.exports = {
  entry:  "./home",
  output: {
    filename: "build.js"
  }
};

I had problems specifying the context - context: __dirname + "./modules",.
The solution was to specify two backslashes - context: __dirname + "\\modules",.
The clue was in the outputprocess.cwd()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question