增加 cdn 编译后的地址
This commit is contained in:
parent
2acc3f568b
commit
dd97b96b27
@ -4,30 +4,40 @@ import { defineConfig } from 'vite'
|
|||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||||
|
|
||||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import { babel } from '@rollup/plugin-babel';
|
import { babel } from '@rollup/plugin-babel'
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig(({ command }) => {
|
||||||
plugins: [
|
// 生产构建时指向 CDN 地址,开发时保持 '/'
|
||||||
vue(),
|
const base = command === 'build'
|
||||||
vueDevTools(),
|
? 'https://images.health.ufutx.com/uftx_case'
|
||||||
babel({
|
: '/'
|
||||||
plugins: [
|
console.log('base', base)
|
||||||
[
|
return {
|
||||||
'@babel/plugin-transform-react-jsx',
|
base,
|
||||||
{
|
|
||||||
runtime: 'automatic',
|
plugins: [
|
||||||
importSource: '@antv/f2',
|
vue(),
|
||||||
},
|
vueDevTools(),
|
||||||
|
babel({
|
||||||
|
plugins: [
|
||||||
|
[
|
||||||
|
'@babel/plugin-transform-react-jsx',
|
||||||
|
{
|
||||||
|
runtime: 'automatic',
|
||||||
|
importSource: '@antv/f2',
|
||||||
|
},
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
}),
|
||||||
}),
|
vueJsx(),
|
||||||
vueJsx(),
|
],
|
||||||
],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
Loading…
Reference in New Issue
Block a user