| | |
| | | import type { ConfigEnv } from 'vite'; |
| | | import { defineConfig, loadEnv } from 'vite'; |
| | | import { CodeInspectorPlugin } from 'code-inspector-plugin'; |
| | | |
| | | import { visualizer } from 'rollup-plugin-visualizer'; |
| | | // import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'; |
| | | // import AutoImport from 'unplugin-auto-import/vite'; |
| | | // import Components from 'unplugin-vue-components/vite'; |
| | | import viteCompression from 'vite-plugin-compression'; |
| | | import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus'; |
| | | const pathResolve = (dir: string) => { |
| | |
| | | viteCompression({ |
| | | threshold: 1024000, |
| | | }), |
| | | // AutoImport({ |
| | | // resolvers: [ElementPlusResolver()], |
| | | // }), |
| | | // Components({ |
| | | // resolvers: [ElementPlusResolver()], |
| | | // }), |
| | | // rollup-plugin-visualizer 打包分析,开启后,npm run build 自动打开打包后的模块图 |
| | | // visualizer({ |
| | | // gzipSize: true, |
| | | // brotliSize: true, |
| | | // emitFile: false, |
| | | // filename: 'stats.html', //分析图生成的文件名 |
| | | // open: true, //如果存在本地服务端口,将在打包后自动展示 |
| | | // }), |
| | | ], |
| | | root: process.cwd(), |
| | | resolve: { alias }, |