If you use HtmlWebpackPlugin editing directly index.html , this is not an option. So, to fix this specific problem, 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: '/' },
Remember to restart the web development server for these changes to take effect.
Read more about publicPath here .
source share