In all the examples I've seen, the entrypoint html file (e.g. index.html) lives alongside all the built assets emitted by webpack.
build/
index.html
bundle.js
1.bundle.js
2.bundle.js
etc
I'd like to have my entrypoint html separate from the built assets:
index.html
build/
bundle.js
1.bundle.js
2.bundle.js
etc
Is this possible with webpack?
Aha, figured it out. In the webpack.config, you have to set output.publicPath
. That path is used to prefix all relative URLs in CSS.
In my case, I used:
output: {
path: path.resolve('./build'),
publicPath: './build/',
filename: '[name].bundle.js'
},
http://webpack.github.io/docs/configuration.html#output-publicpath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With