Webpack-dev-server not bundling even after showing bundle valid message

前端 未结 6 711
渐次进展
渐次进展 2021-02-02 08:22

I\'ve set up a basic react application with webpack but I couldn\'t get the webpack-dev-server running properly.

I\'ve installed webpack-dev-server

6条回答
  •  隐瞒了意图╮
    2021-02-02 09:06

    I've got the issue resolved by myself. Silly as it sounds but the issue was with the publicPath under the output object. It should match the path property instead of just /build/, i.e.,

    output: {
        path: path.join(__dirname, 'build/js'),
        publicPath: '/build/js', // instead of publicPath: '/build/' 
        filename: '[name].js'
    },
    

提交回复
热议问题