A Webpack plugin for bundling group of packages as DLLs
npm install webpack-dll-bundles-pluginDllPlugin & DllReferencePlugin to create bundle configurations as part of the build process.``
const webpackMerge = require('webpack-merge'); // used to merge webpack configs
const commonConfig = require('./webpack.common.js'); // the settings that are common
new DllBundlesPlugin({
bundles: {
polyfills: [
'core-js',
'zone.js',
],
vendor: [
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/core',
'@angular/common',
'@angular/forms',
'@angular/http',
'@angular/router',
'@angularclass/hmr',
'rxjs',
]
},
dllDir: './dll',
webpackConfig: webpackMerge(commonConfig({env: ENV}), {
devtool: 'cheap-module-source-map',
plugins: [] // DllBundlesPlugin will set the DllPlugin here
})
})
`
> webpackConfig Accepts a path (string), webpack config object or webpack config object factory.
DllBundlesPlugin will override the entry and add the DllPlugins requires. DllBundlesPlugin will also add the DllReferencePlugin to the webpack configuration it is defined on.
function.`
new AddAssetHtmlPlugin([
{ filepath: helpers.root(dll/${DllBundlesPlugin.resolveFile('polyfills')}) },
{ filepath: helpers.root(dll/${DllBundlesPlugin.resolveFile('vendor')}) }
])
``