43 lines
966 B
TypeScript
43 lines
966 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'
|
|
? 'https://images.health.ufutx.com/dp_uftx_case'
|
|
: '/'
|
|
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)),
|
|
},
|
|
},
|
|
}
|
|
}) |