Dear all
I'm using very simple html-webpack-plugin setup
module.exports = {
...
plugins: [
new HtmlPlugin({
template: './template.html'
})
]
}
The output HTML <script> is: <script type="text/javascript" src="ab56bd038d9a7da68390.bundle.js"></script>
Is it possible to have output HTML <script> to <script type="text/javascript" src="/ab56bd038d9a7da68390.bundle.js"></script> (/ in front of the bundle file) because without / I have a problem when using with react-router e.g. when the URL was http://localhost:8080/customers/101 the browser will look for /customers/ab56bd038d9a7da68390.bundle.js instead of /ab56bd038d9a7da68390.bundle.js
Please guide thanks
Try this
module.exports = {
...
output: {
publicPath: '/',
...
},
plugins: [
new HtmlPlugin({
template: './template.html'
})
]
}
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Try this