-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
55 lines (54 loc) · 1.74 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* The AGPL License (AGPL)
* Copyright (c) 2023 hans000
*/
import { defineConfig } from 'vite'
import reactRefresh from '@vitejs/plugin-react-refresh'
// import vitePluginImport from 'vite-plugin-babel-import'
import cdnImport from 'vite-plugin-cdn-import'
export default defineConfig({
base: './',
css: {
preprocessorOptions: {
less: { javascriptEnabled: true }
}
},
plugins: [
reactRefresh(),
cdnImport({
modules: [
{
name: 'react',
var: 'React',
path: 'https://unpkg.com/[email protected]/umd/react.production.min.js',
},
{
name: 'react-dom',
var: 'ReactDOM',
path: 'https://unpkg.com/[email protected]/umd/react-dom.production.min.js',
},
{
name: '@ant-design/icons',
var: 'icons',
path: 'https://unpkg.com/@ant-design/[email protected]/dist/index.umd.js',
},
{
name: 'antd',
var: 'antd',
path: 'https://unpkg.com/[email protected]/dist/antd.min.js',
css: 'https://unpkg.com/[email protected]/dist/antd.min.css',
},
{
name: 'jszip',
var: 'JSZip',
path: 'https://unpkg.com/[email protected]/dist/jszip.min.js',
},
// {
// name: 'idbKeyval',
// var: 'idbKeyval',
// path: 'https://unpkg.com/[email protected]/dist/umd.js',
// },
]
}),
]
})