[Vuejs]-How to change vue build.js?

0👍

This issue is caused because you’ve upgraded from Webpack 3 to Webpack 4, which introduced some changes to the configuration API for optimizations according to this change log

The new API works somewhat differently, and the way webpack chunk your application is different.

Here is a default example of how config.optimization.splitChunks can be used in your configuration file.

optimization: {
    minimize: false,
    runtimeChunk: false,
    splitChunks: {
        chunks: "all",
        minSize: 30000,
        minChunks: 1,
        maxAsyncRequests: 5,
        maxInitialRequests: 3,
        automaticNameDelimiter: '-',
        name: true,
        cacheGroups: {
            default: {
                minChunks: 2,
                priority: -20,
                reuseExistingChunk: true
            },
            vendor: {
                test: /[\\/]node_modules[\\/]/,
                priority: -10,
                chunks: 'all'
            }
        }
    }
}

Leave a comment