remove commonChunksPlugin

This commit is contained in:
Pooya Parsa 2018-02-26 13:54:10 +03:30
parent 1f4159fca3
commit eb2e0c5ccd

View File

@ -38,9 +38,6 @@ module.exports = function webpackClientConfig() {
config.devtool = this.options.dev ? 'cheap-source-map' : false
config.output.devtoolModuleFilenameTemplate = '[absolute-resource-path]'
// Add CommonChunks plugin
commonChunksPlugin.call(this, config)
// Env object defined in nuxt.config.js
let env = {}
each(this.options.env, (value, key) => {
@ -78,15 +75,6 @@ module.exports = function webpackClientConfig() {
})
)
// Extract webpack runtime & manifest
config.plugins.push(
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
minChunks: Infinity,
filename: this.getFileName('manifest')
})
)
// Define Env
config.plugins.push(
new webpack.DefinePlugin(
@ -233,28 +221,6 @@ module.exports = function webpackClientConfig() {
return config
}
// --------------------------------------------------------------------------
// Adds Common Chunks Plugin
// --------------------------------------------------------------------------
function commonChunksPlugin(config) {
// Create explicit vendor chunk
config.plugins.unshift(
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
filename: this.getFileName('vendor'),
minChunks(module, count) {
// A module is extracted into the vendor chunk when...
return (
// If it's inside node_modules
/node_modules/.test(module.context) &&
// Do not externalize if the request is a CSS file or a Vue file which can potentially emit CSS assets!
!/\.(css|less|scss|sass|styl|stylus|vue)$/.test(module.request)
)
}
})
)
}
// --------------------------------------------------------------------------
// Adds DLL plugin
// https://github.com/webpack/webpack/tree/master/examples/dll-user