optimize: ♻️ 减少打包体积
This commit is contained in:
parent
3efb9ef2b3
commit
d309aa3129
|
@ -20,7 +20,7 @@ VITE_BASE_API_RETRY=5
|
|||
VITE_BASE_API_RETRY_DELAY=3000
|
||||
|
||||
# 是否在打包时使用cdn替换本地库 替换 true 不替换 false
|
||||
VITE_CDN=false
|
||||
VITE_CDN=true
|
||||
|
||||
# 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件)
|
||||
# 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认)
|
||||
|
|
|
@ -30,7 +30,7 @@ export const buildEnvironment = () => {
|
|||
// 规定触发警告的 chunk 大小, 当某个代码分块的大小超过该限制时,Vite 会发出警告
|
||||
chunkSizeWarningLimit: 2000,
|
||||
rollupOptions: {
|
||||
external: [],
|
||||
external: ['md-editor-v3', 'echarts'],
|
||||
input: {
|
||||
index: pathResolve('../index.html', import.meta.url),
|
||||
},
|
||||
|
|
11
build/cdn.ts
11
build/cdn.ts
|
@ -57,5 +57,16 @@ export const cdn = importToCDN({
|
|||
var: 'echarts',
|
||||
path: 'dist/echarts.min.js',
|
||||
},
|
||||
{
|
||||
name: 'md-editor-v3',
|
||||
var: 'MdEditorV3',
|
||||
path: 'lib/umd/index.js',
|
||||
css: 'lib/style.css',
|
||||
},
|
||||
{
|
||||
name: 'pinyin-pro',
|
||||
var: 'pinyinPro',
|
||||
path: 'dist/index.mjs',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue