webpack --watch isn't compiling changed files

后端 未结 30 1062
眼角桃花
眼角桃花 2020-12-02 06:00

I tried running webpack --watch and after editing my JS files, it doesn\'t trigger an auto-recompilation.

I\'ve tried reinstalling webpack

30条回答
  •  北海茫月
    2020-12-02 06:13

    What was the cause in my case:

    It seems that the value of: max_user_watches in the /proc/sys/fs/inotify/max_user_watches is affecting webpack

    To check your actual value

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

    16384 was in my case and it still wasnt enough.

    I tried different type of solutions like:

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

    But it seems that even if I changed the value, when I restarted my PC it would go back to default one 16384.

    SOLUTION if you have Linux OS(my case, I have Manjaro):

    Create the file:

    sudo nano /etc/sysctl.d/90-override.conf

    And populate it with:

    fs.inotify.max_user_watches=200000

    It seems 200000 is enough for me.

    After you create the file and add the value, just restart the PC and you should be ok.

提交回复
热议问题