Skip to content

How to use splitChunks webpack system with vue cli 3? #2184

@isaumya

Description

@isaumya

Hi,
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions