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

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

    After a long search I found the solution for my problem, in my case output path wasn't configured correctly.

    This configuration solved my problem:

    const path = require('path');
    
    module.exports = {
      "entry": ['./app/index.js'],
      "output": {
        path: path.join(__dirname, 'build'),
        publicPath: "/build/",
        "filename": "bundle.js"
      }....
    

提交回复
热议问题