| | |
| | | import AutoImport from 'unplugin-auto-import/vite' |
| | | import basicSsl from '@vitejs/plugin-basic-ssl' |
| | | import { fa } from 'element-plus/es/locales.mjs' |
| | | import viteCompression from 'vite-plugin-compression' |
| | | |
| | | export default ({ mode, command }) => { |
| | | const env = loadEnv(mode, process.cwd()) |
| | |
| | | basicSsl(), |
| | | AutoImport({ |
| | | imports: ["vue", "vue-router"], // 自动导入vue和vue-router相关函数 |
| | | }) |
| | | }), |
| | | viteCompression({ |
| | | filter: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i, // 需要压缩的文件 |
| | | threshold: 512, // 文件容量大于这个值进行压缩 |
| | | algorithm: 'gzip', // 压缩方式 |
| | | ext: 'gz', // 后缀名 |
| | | deleteOriginFile: true, // 压缩后是否删除压缩源文件 |
| | | }) |
| | | ], |
| | | |
| | | css: { |