You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used DllPlugin to split vendors, and add-asset-html-webpack-plugin is introduced to integrate the vendors into the html-webpack-plugin's output.
plugins: [
new AddAssetHtmlPlugin({
filepath: path.resolve(__dirname, './dist/vendor/vendor.*.dll.js'),
includeSourcemap: false
}),
new webpack.DllReferencePlugin({
context: __dirname,
manifest: require('./dist/vendor/manifest.json')
}),
new HtmlWebpackPlugin({
inject: false,
template: require('html-webpack-template')
}),
]
When I introduced html-webpack-template in my webpack configuration, an issue occurs: The HTML file generated by html-wepack-template doesn't contain the vendor bundle, though listed in the output of webpack.
When I config the HtmlWebpackPlugin with inject: true, the webpage works, but there are two app.js included in the HTML files, one by HtmlWebpackPlugin and the other by html-webpack-template. It's not the best practice.
I try to import the vendor.js by using scripts parameters of html-webpack-template, but it seems that globbing is not supported, which makes me confusing in dealing with a vendor bundle with chunkhash.
The text was updated successfully, but these errors were encountered:
Thanks for the issue filing with great detail and for the thumbs up that was left here. This issue sounds like it has merit, but it's beyond my current knowledge to deal with. If you'd like to submit a concrete code solution, I'd be happy to learn along, but I'm probably not going to tackle this otherwise.
Description
I used DllPlugin to split vendors, and add-asset-html-webpack-plugin is introduced to integrate the vendors into the html-webpack-plugin's output.
When I introduced html-webpack-template in my webpack configuration, an issue occurs:
The HTML file generated by html-wepack-template doesn't contain the vendor bundle, though listed in the output of webpack.
Webpack's output:
HTML files:
Solutions I've tried
inject: true
, the webpage works, but there are two app.js included in the HTML files, one by HtmlWebpackPlugin and the other by html-webpack-template. It's not the best practice.The text was updated successfully, but these errors were encountered: