12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- import vueJsx from '@vitejs/plugin-vue-jsx'
- import qiankun from 'vite-plugin-qiankun'
- // https://vite.dev/config/
- export default defineConfig({
- plugins: [
- vue(),
- vueJsx(),
- qiankun('curstom-form', {
- useDevMode: true, // 开发模式下使用热更新
- }),
- ],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url)),
- },
- },
- server: {
- port: 5173,
- cors: true,
- },
- base: '/saas/form/',
- build: {
- target: 'esnext',
- outDir: 'form',
- chunkSizeWarningLimit: 1000,
- terserOptions: {
- compress: {
- drop_console: true,
- drop_debugger: true,
- },
- },
- rollupOptions: {
- output: {
- assetFileNames: 'static/[name].[hash].[ext]', // 确保静态资源路径正确
- chunkFileNames: 'static/[name].[hash].js',
- entryFileNames: 'static/[name].[hash].js',
- },
- },
- },
- })
|