| | |
| | | import { defineConfig, loadEnv } from 'vite'; |
| | | import viteCompression from 'vite-plugin-compression'; |
| | | import vueSetupExtend from 'vite-plugin-vue-setup-extend-plus'; |
| | | import { CodeInspectorPlugin } from 'code-inspector-plugin'; |
| | | |
| | | const pathResolve = (dir: string) => { |
| | | return resolve(__dirname, '.', dir); |
| | |
| | | const env = loadEnv(mode.mode, process.cwd()); |
| | | return { |
| | | plugins: [ |
| | | |
| | | vue(), |
| | | vueSetupExtend(), |
| | | viteCommonjs(), |
| | |
| | | viteCompression({ |
| | | threshold: 1024000, |
| | | }), |
| | | // CodeInspectorPlugin({ |
| | | // bundler: 'vite', |
| | | // hotKeys: ['shiftKey'], |
| | | // }), |
| | | ], |
| | | root: process.cwd(), |
| | | resolve: { alias }, |
| | |
| | | host: '0.0.0.0', |
| | | port: env.VITE_PORT as unknown as number, |
| | | open: JSON.parse(env.VITE_OPEN), |
| | | hmr: false, |
| | | hmr: true, |
| | | proxy: { |
| | | '/gitee': { |
| | | target: 'https://gitee.com', |