Currently, I am using Webpack 4 to build multiple bundles. My requirement is to add the output options libraryTarget
and library
for a single bundle only.
The default configuration looks like this:
output: {
path: path.resolve(__dirname, 'dist/js'),
filename: '[name].[chunkhash].js',
},
But for a specific bundle, I need the following settings:
output: {
path: path.resolve(__dirname, 'dist/js'),
filename: '[name].[chunkhash].js',
libraryTarget: 'var',
library: '[name]'
},
I can't find any examples in the documentation. Is it possible to achieve this?