I am naming the runtimeChunk as manifest, and using the InlineManifestWebpackPlugin with the string option of the same name: manifest. The webpack config is setup like the following:
optimization: {
runtimeChunk: {
name: 'manifest'
}
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin(htmlTemplate),
new InlineManifestWebpackPlugin('manifest'),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
And the html-webpack template has the inlineManifestWebpackName: 'manifest', defined like the following:
Description
I am naming the runtimeChunk as
manifest
, and using theInlineManifestWebpackPlugin
with the string option of the same name:manifest
. The webpack config is setup like the following:And the html-webpack template has the
inlineManifestWebpackName: 'manifest',
defined like the following:The final HTML file looks like when
inject: false
:with
inject: true
It's not really clear why
inject: false
is not working. And in theinject: true
I get duplicate files.