ufutx.dma.case.h5/vite.config.ts
2026-10-29 23:37:27 +08:00

43 lines
929 B
TypeScript

import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// import vueDevTools from 'vite-plugin-vue-devtools'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { babel } from '@rollup/plugin-babel'
// https://vite.dev/config/
export default defineConfig(({ command }) => {
// 生产构建时指向 CDN 地址,开发时保持 '/'
const base = command === 'build'
? '/'
: '/'
console.log('base', base)
return {
base,
plugins: [
vue(),
// vueDevTools(),
babel({
plugins: [
[
'@babel/plugin-transform-react-jsx',
{
runtime: 'automatic',
importSource: '@antv/f2',
},
],
],
}),
vueJsx(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
}
})