webpack-dev-server无法获得/?

时间:2018-08-30 04:51:10

标签: web webpack webpack-dev-server

这是我的webpack.config.js

devserver:

devServer: {
   contentBase: path.join(__dirname, 'dist'),
   compress: true,
   port: 9000
},

输出:

 output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'js/[name].min.js',
    },

package.json

"scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "watch": "webpack --watch",
        "start": "webpack-dev-server --open",
        "build": "webpack --env.production"
}

当我运行npm start时,浏览器始终无法获取/。

git bash

git bash result

浏览器控制台

browser console

0 个答案:

没有答案