Created
May 7, 2018 13:31
-
-
Save romanlex/10bc2a187e480ea7709f4f37df13794c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
plugins: [ | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'app', | |
async: 'common', | |
children: true, | |
deepChildren: true, | |
minChunks: (module, count) => { | |
return count >= 3 && module.context && !module.context.includes('node_modules'); | |
}, | |
}), | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'app', | |
children: true, | |
deepChildren: true, | |
minChunks: (module) => { | |
if (module.resource && (/^.*\.(css|scss|sass)$/).test(module.resource)) { | |
return false; | |
} | |
return module.context && module.context.includes('node_modules'); | |
}, | |
}), | |
new webpack.optimize.CommonsChunkPlugin({ | |
name: 'vendor', | |
minChunks: (module) => { | |
if (module.resource && (/^.*\.(css|scss|sass)$/).test(module.resource)) { | |
return false; | |
} | |
return module.context && module.context.includes('node_modules'); | |
}, | |
}), | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Для случая когда необходимо выделить
vendor
из всех entry точек входа и дочерних асинхронных чанковИмпортируемые при этом стили из node_modules будут попадать в главный entry