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

前端 未结 11 1836
-上瘾入骨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 17:18

    This happened to me as well after running two different applications on the same webpack-dev-server port after one another. This happened even though the other project was shut down. When I changed to a port that had not been used it started working directly.

    devServer: {
        proxy: {
            '*': {
                target: 'http://localhost:1234'
            }
        },
        port: 8080,
        host: '0.0.0.0',
        hot: true,
        historyApiFallback: true,
    },
    

    If you use Chrome like me then just open Developer Tools and click on Clear site data. You can also see if this is the problem by running the site in incognito mode.

提交回复
热议问题