Webpack-dev-server compiles files but does not refresh or make compiled javascript available to browser

前端 未结 11 1821
-上瘾入骨i
-上瘾入骨i 2020-12-04 16:51

I\'m trying to use webpack-dev-server to compile files and start up a dev web server.

In my package.json I have the script property set to:



        
11条回答
  •  无人及你
    2020-12-04 16:58

    the right solution

    Tell dev-server to watch the files served by the devServer.watchContentBase option.

    It is disabled by default.

    When enabled, file changes will trigger a full page reload.

    Example:

    module.exports = {
      //...
      devServer: {
        // ...
        watchContentBase: true
      }
    };
    

提交回复
热议问题