| | |
| | | import { defineConfig } from 'vite' |
| | | import vue from '@vitejs/plugin-vue' |
| | | import vueDevTools from 'vite-plugin-vue-devtools' |
| | | |
| | | const timestamp = new Date().getTime() |
| | | // https://vite.dev/config/ |
| | | export default defineConfig({ |
| | | base: '/examination/user', |
| | | plugins: [vue(), vueDevTools()], |
| | | define: { |
| | | // 注入构建时间戳到代码中 |
| | | '__BUILD_TIME__': JSON.stringify(timestamp) |
| | | }, |
| | | rollupOptions: { |
| | | output: { |
| | | // 在文件名中加入时间戳,确保每次构建都不同 |
| | | entryFileNames: `assets/js/[name]-[hash]-${timestamp}.js`, |
| | | chunkFileNames: `assets/js/[name]-[hash]-${timestamp}.js`, |
| | | assetFileNames: `assets/[ext]/[name]-[hash]-${timestamp}.[ext]` |
| | | } |
| | | }, |
| | | resolve: { |
| | | alias: { |
| | | '@': fileURLToPath(new URL('./src', import.meta.url)), |
| | | }, |
| | | }, |
| | | server: { |
| | | allowedHosts: ['dev.qxueyou.com'], |
| | | host: '0.0.0.0', |
| | | proxy: { |
| | | '/app-api': { |
| | | target: 'http://101.43.143.75:48180', // dev |