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

前端 未结 11 1798
-上瘾入骨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:52

    I'll add my own special tale of Webpack --watch woe to the wall of suffering here.

    I was running

    webpack --watch
    

    in order to build a Typescript project. The compiled .js files would update, but the bundle that the browser was seeing would not. So I was basically in the same position as the OP.

    My problem came down to the watchOptions.ignored parameter. The original author of the build config had set up ignored as a filter function, which turns out to not be a valid value for that parameter. Replacing the filter function with an appropriate RegExp got the --watch build working again for me.

提交回复
热议问题