mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: optimize resource load
This commit is contained in:
1 parent
e935558702
commit
f43c1bc8c9
11 files changed
+38
-40
No files matched your search
@@ -130,30 +130,21 @@ export default function (env = {}) {
|
||||
maxInitialRequests: 3,
|
||||
automaticNameDelimiter: '-',
|
||||
cacheGroups: {
|
||||
monaco: {
|
||||
test: /[\\/]monaco-editor[\\/]/,
|
||||
priority: 9,
|
||||
name: 'monaco',
|
||||
},
|
||||
vditor: {
|
||||
test: /[\\/]vditor[\\/]/,
|
||||
priority: 8,
|
||||
name: 'vditor',
|
||||
},
|
||||
echarts: {
|
||||
test: /[\\/]echarts[\\/]/,
|
||||
priority: 7,
|
||||
name: 'echarts',
|
||||
},
|
||||
graphql: {
|
||||
test: /[\\/](graphiql|codemirror)[\\/]/,
|
||||
priority: 6,
|
||||
name: 'gql-cm',
|
||||
style: {
|
||||
test: /\.(css|styl|less|sass|scss)$/,
|
||||
priority: 99,
|
||||
name: 'style',
|
||||
},
|
||||
vendors: {
|
||||
test: /[\\/]node_modules[\\/].+\.([jt]sx?|json|yaml)$/,
|
||||
priority: -10,
|
||||
name: 'vendors',
|
||||
name(module) {
|
||||
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
|
||||
if (packageName === 'monaco-editor-nls') {
|
||||
return `i.monaco.${module.userRequest.split('/').pop().split('.')[0]}`;
|
||||
}
|
||||
return `n.${packageName.replace('@', '')}`;
|
||||
},
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
default: {
|
||||
|
||||
Reference in new issue
Block a user