I have a React app with navigation powered by react-router
that I run in development with webpack-dev-server
and the history fallback option enabled. H
@niba's answer perfectly solved my problem. I have been having the problem that when I nest a
element inside a component that is already being rendered by a
, it will fail to load the script bundle.js when I try to go to a sub-route url. After adding the following in the webpackConfig.json, everything is back to normal.
module.exports = {
...
output: {
path: path.resolve('dist'),
publicPath: '/',
filename: 'bundle.js'
},
...
}