webpack 2 historyApiFallback 不工作,找不到 404
webpack 2 historyApiFallback is not working, 404 not found
我只使用简单的 grunt-webpack,但它不工作。
总是得到 404。我需要使用 Angular 2 路由器我可以看到 webpack-dev-server 不工作,不服务。
在我试过的配置中:
output: {
path: root(folder.build.dist.root),
publicPath: '/',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
devServer: {
historyApiFallback: {
index: '/index.html'
},
stats: true,
inline: true,
progress: true
}
是的,修好了!
我正在使用 grunt-webpack,所以配置 devServer 不工作。
我不得不像这样用 grunt 添加 devServer 配置:
"webpack-dev-server": {
options: {
webpack: webpackConfigDev,
},
'cory-run': webpackConfigDev.devServer
},
我只使用简单的 grunt-webpack,但它不工作。 总是得到 404。我需要使用 Angular 2 路由器我可以看到 webpack-dev-server 不工作,不服务。
在我试过的配置中:
output: {
path: root(folder.build.dist.root),
publicPath: '/',
filename: '[name].js',
chunkFilename: '[id].chunk.js'
},
devServer: {
historyApiFallback: {
index: '/index.html'
},
stats: true,
inline: true,
progress: true
}
是的,修好了! 我正在使用 grunt-webpack,所以配置 devServer 不工作。 我不得不像这样用 grunt 添加 devServer 配置:
"webpack-dev-server": {
options: {
webpack: webpackConfigDev,
},
'cory-run': webpackConfigDev.devServer
},