-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
60 lines (58 loc) · 1.36 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
56
57
58
59
60
import {resolve} from 'path'
import {visualizer} from 'rollup-plugin-visualizer'
import {defineConfig} from 'vite'
import dynamicImport from 'vite-plugin-dynamic-import'
import tsconfigPaths from 'vite-tsconfig-paths'
export default defineConfig({
plugins: [
tsconfigPaths(),
dynamicImport(),
visualizer()
],
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
modifyVars: {
'root-entry-name': 'variable'
}
}
}
},
esbuild: {
jsxFactory: 'React.createElement',
jsxFragment: 'Fragment',
minify: true,
legalComments: 'none',
charset: 'utf8'
},
build: {
target: 'ES2015',
rollupOptions: {
input: {
'micro-lc-notification-center': resolve(__dirname, 'src/index.min.ts'),
},
output: {
entryFileNames: ({name}) => `${name}.esm.js`,
manualChunks: {
adoptedStyleSheets: ['construct-style-sheets-polyfill'],
engine: ['react', 'react-dom', 'lit'],
antd: ['antd/es', '@ant-design/colors', '@ant-design/icons/es/icons'],
index: ['src/index.min.ts']
}
}
},
outDir: 'dist/unpkg',
emptyOutDir: false,
manifest: true,
minify: 'esbuild'
},
resolve: {
alias: [
{
find: /@ln/,
replacement: './../node_modules/dayjs/locale'
}
]
}
})