We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbf7a05 + 67e7437 commit 69425a3Copy full SHA for 69425a3
blog-view/vue.config.js
@@ -10,5 +10,29 @@ module.exports = {
10
'plugins': '@/plugins'
11
}
12
13
- }
+ },
14
+ optimization: {
15
+ splitChunks: {
16
+ cacheGroups: {
17
+ vendor: {
18
+ test: /[\\/]node_modules[\\/]/,
19
+ name(module) {
20
+ // get the name. E.g. node_modules/packageName/not/this/part.js
21
+ // or node_modules/packageName
22
+ const packageName = module.context.match(
23
+ /[\\/]node_modules[\\/](.*?)([\\/]|$)/
24
+ )[1];
25
+ // npm package names are URL-safe, but some servers don't like @ symbols
26
+ return `npm.${packageName.replace("@", "")}`;
27
28
+ chunks: "all",
29
+ enforce: true,
30
+ priority: 10,
31
+ minSize: 50000, // 50KB
32
+ maxSize: 200000,
33
+ reuseExistingChunk: true,
34
35
36
37
38
0 commit comments