I build a project with Webpack and react-rounter. this is my code:
If you happen to be using the HtmlWebpackPlugin editing directly index.html is not an option. So, to fix this particular issue, add publicPath and specify / as the root folder inside webpack.config.js:
const path = require('path')
module.exports = {
entry: './app/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
// more config stuff goes below..
}
Don't forget to restart the webpack dev server for these changes to take effect
More info about publicPath here.