-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
35 lines (34 loc) · 1.01 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import importToCDN from 'vite-plugin-cdn-import'
// import { visualizer } from "rollup-plugin-visualizer"
import { resolve } from 'path'
export default defineConfig({
base: './',
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
'@antv/g-lite': resolve(__dirname, 'src/g-lite')
}
},
plugins: [
react(),
importToCDN({
modules: [
{
name: 'react',
var: 'React',
path: `https://cdn.staticfile.org/react/18.2.0/umd/react.production.min.js`,
// path: `https://cdnjs.cloudflare.com/ajax/libs/react/18.2.0/umd/react.production.min.js`
},
{
name: 'react-dom',
var: 'ReactDOM',
path: `https://cdn.staticfile.org/react-dom/18.2.0/umd/react-dom.production.min.js`,
// path: `https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production.min.js`
}
]
}),
// visualizer()
]
})