MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / webpackPlugin

Function webpackPlugin

config/plugin.config.js:29–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29export const webpackPlugin = config => {
30 // optimize chunks
31 config.optimization // share the same chunks across different modules
32 .runtimeChunk(false)
33 .splitChunks({
34 chunks: 'async',
35 name: 'vendors',
36 maxInitialRequests: Infinity,
37 minSize: 0,
38 cacheGroups: {
39 vendors: {
40 test: module => {
41 const packageName = getModulePackageName(module) || '';
42
43 if (packageName) {
44 return [
45 'bizcharts',
46 'gg-editor',
47 'g6',
48 '@antv',
49 'l7',
50 'gg-editor-core',
51 'bizcharts-plugin-slider',
52 ].includes(packageName);
53 }
54
55 return false;
56 },
57
58 name (module) {
59 const packageName = getModulePackageName(module);
60
61 if (packageName) {
62 if (['bizcharts', '@antv_data-set'].indexOf(packageName) >= 0) {
63 return 'viz'; // visualization package
64 }
65 }
66
67 return 'misc';
68 },
69 },
70 },
71 });
72};
73
74export const plugins = [
75 ['umi-plugin-antd-icon-config', {}],

Callers

nothing calls this directly

Calls 1

getModulePackageNameFunction · 0.85

Tested by

no test coverage detected