I am in the process of migrating my webpack 1 project to webpack 2.
Most of it is working smoothly, except for the issue I am facing with html-webpack-plugin:
When using it in webpack 2, the script tag that gets generated looks like this:
<script type="text/javascript" src="static/js/bundle.js"></script>
Instead of what I want, which is:
<script type="text/javascript" src="/static/js/bundle.js"></script>
Interestingly, when using the same plugin options, everything behaves as expected in Webpack 1.
Below are some relevant snippets from my webpack configuration:
entry: [
paths.appIndexJs,
publicPath,
],
output: {
pathinfo: true,
path: paths.appBuild,
filename: 'static/js/bundle.js',
},
// (...)
plugins: [
new HtmlWebpackPlugin({
inject: true,
template: paths.appHtml,
}),
Any thoughts on what might be causing this discrepancy?