BrowserHistory(react-router v4)返回404,historyApiFallback不起作用。BrowserHistory(react-router v4)返回404,historyApiFallback不起作用
所以,当我去http://localhost:3000/app我得到了404。我尝试了以下解决方案,没有用......任何想法?我也试过historyApiFallback设置为true和index.html中不使用相对路径bundle.js即/static/bundle.js
historyApiFallback doesn't work in Webpack dev server historyApiFallback doesn't work, for scripts, if you're nested multiple path sections deep
的Index.html
`<script src="bundle.js"></script`>
Webpack输出
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js',
publicPath: '/'
},
的WebPack devServer
historyApiFallback: { index: 'public/index.html' },