-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
47 lines (44 loc) · 1.46 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
import path from "path";
import { defineConfig } from "vite";
import packageJson from "./package.json";
import excludeDependenciesFromBundle from "rollup-plugin-exclude-dependencies-from-bundle";
import typescript from '@rollup/plugin-typescript'
const config = defineConfig({
base: "./",
debug: true,
build: {
emptyOutDir: true,
minify: false,
lib: {
entry: {
'all': './src/all.ts',
'base': './src/base.ts',
'ui': './src/ui.ts',
'form': './src/form.tsx',
'modal': './src/modal.tsx',
'menu': './src/menu.tsx',
},
},
rollupOptions: {
external: ['react', '@emotion', '@emotion/css', '@emotion/styled', '@emotion/react'],
plugins: [excludeDependenciesFromBundle(), typescript()],
output: {
// Provide global variables to use in the UMD build
// for externalized deps
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'lodash-es': 'lodashEs',
'@restart/ui': '@restart/ui',
'@emotion/css': 'EmotionCSS',
'@emotion/styled': 'EmotionStyled',
'@emotion/react': 'EmotionReact',
},
}
}
},
test: {
environment: 'node',
},
});
export default config