diff --git a/.env.production b/.env.production index 5abfbd1..ce69b86 100644 --- a/.env.production +++ b/.env.production @@ -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(不开启压缩,默认) diff --git a/build/buildEnv.ts b/build/buildEnv.ts index 283a2a9..70ae90a 100644 --- a/build/buildEnv.ts +++ b/build/buildEnv.ts @@ -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), }, diff --git a/build/cdn.ts b/build/cdn.ts index 49ca6e4..90b46aa 100644 --- a/build/cdn.ts +++ b/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', + }, ], });