Webpack --watch exits after building once

I used the statement webpack --watchto run my web package in view mode to create my ReactJS application. However, for some reason, it stopped working. Now it just compiles the code once and completes

I tried the methods suggested in this SO-mail: webpack --watch does not compile modified files

However, this did not solve the problem for me. Any help could be fixed.

+4
source share
2 answers

The problem seems to have arisen due to inotify watch limitation

Listen inotify Linux . , .

$ cat /proc/sys/fs/inotify/max_user_watches

8192, Linux x64

,

$ sudo sysctl fs.inotify.max_user_watches=524288
$ sudo sysctl -p

run

$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
$ sudo sysctl -p
+6

, node_modules . - :

  watchOptions: {
    aggregateTimeout: 300,
    poll: 1000,
    ignored: /node_modules/
  }

webpack.config.js.

+1

Source: https://habr.com/ru/post/1678363/


All Articles