How to use splitChunks webpack system with vue cli 3?
See original GitHub issueHi,
I wanna use the splitChunk
option of webpack. I’ve created the vie.config.js
file and put the following in there:
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.splitChunks = {
cacheGroups: {
node_vendors: {
test: /[\\/]node_modules[\\/]/,
chunks: "all",
priority: 1
}
}
}
}
}
}
But when I build my app, nothing gets changed. I’ve also posted in stackoverflow: https://stackoverflow.com/questions/51816020/how-to-break-the-js-files-into-chunks-in-vue-cli-3-with-webpack-performance-obje/ Did not get any help from there as well. Can anyone please reply?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
vue.js - How to correctly set optimization.splitChunks ...
I'm looking to modify the splitChunks.automaticNameDelimiter Webpack setting when using Vue CLI vue.config.js settings, but I don't quite ...
Read more >SplitChunksPlugin - webpack
Assign modules to a cache group by module layer. splitChunks.maxSize. number = 0. Using maxSize (either globally optimization.splitChunks.maxSize ...
Read more >How to use Webpack code splitting with Vue.js - Medium
Webpack provides a code splitting feature which allows you to create chunks which can then be loaded on demand. We will use: the...
Read more >Build Targets - Vue CLI
When you run vue-cli-service build , you can specify different build targets via the --target option. This allows you to use the same...
Read more >A mostly complete guide to webpack 5 (2020)
Should you learn webpack? Today CLI tools as create-react-app or Vue cli abstract away most of the configuration, and provide sane defaults.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi all, I’m using the following code inside
vue.config.js
file and it is working, So, I’m sharing my code here:Hope this helps.
Hello, your issue has been closed because it does not conform to our issue requirements. In order to ensure every issue provides the necessary information for us to investigate, we require the use of the Issue Helper when creating new issues. Thank you!