编译webpack并运行本地主机时出现问题

时间:2018-05-17 11:38:15

标签: webpack localhost

我正在尝试使用web pack服务器运行html文件,在编译webpack期间我在cmd中收到以下错误但是webpack已成功编译。

content is served from ./dist+/public
404s will fallback to /index.html

和 当我尝试运行localhost时,我收到错误,如下所示

Cannot GET /details 

我尝试过配置webpack.config.js文件。那没起效。 Webp包版本是:

 "webpack": "^1.13.3",
    "webpack-dev-server": "^1.16.2"

和webpack.config.js文件是:

devServer: {
        inline: true,
        contentBase: './dist+/public',
        port: 3000,
        devtool: 'eval',
        hot: true,
        historyApiFallback: true
    }

请帮我解决问题。

1 个答案:

答案 0 :(得分:0)

此行看起来不对,您将整个操作作为字符串传递

contentBase: './dist+/public',

看看是否有效

contentBase:path.join('./dist','public);