优化全局样式和 element ui框架,修改nacos-federation,增加打包依赖分析等
This commit is contained in:
@@ -3,6 +3,7 @@ import federation from "@originjs/vite-plugin-federation";
|
||||
import { nacosRegVitePlugin } from "nacos-federation";
|
||||
// @ts-ignore
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import visualizer from 'rollup-plugin-visualizer';
|
||||
|
||||
export default defineConfig(async ({ mode }): Promise<UserConfig> => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
@@ -24,6 +25,7 @@ export default defineConfig(async ({ mode }): Promise<UserConfig> => {
|
||||
"./utils": "./src/utils/index.ts",
|
||||
"./element-plus": "./src/lib/element-plus.ts",
|
||||
"./normalize": "./src/styles/common/index.ts",
|
||||
"./pub": "./src/styles/pub/index.ts",
|
||||
},
|
||||
shared: {
|
||||
vue: { import: false, generate: false, requiredVersion: '^3.5.18' },
|
||||
@@ -31,7 +33,14 @@ export default defineConfig(async ({ mode }): Promise<UserConfig> => {
|
||||
'element-plus': { requiredVersion: '^2.11.3' }
|
||||
}
|
||||
}),
|
||||
vue()
|
||||
vue(),
|
||||
visualizer({
|
||||
title: "共享模块依赖分析",
|
||||
filename: 'dist/stats.html', // 分析文件输出路径
|
||||
open: false, // 构建完成后自动打开
|
||||
gzipSize: true, // 显示gzip后的大小
|
||||
brotliSize: true, // 显示brotli后的大小
|
||||
})
|
||||
],
|
||||
build: {
|
||||
target: 'esnext',
|
||||
|
||||
Reference in New Issue
Block a user