-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathvite.config.ts
53 lines (49 loc) · 1.35 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
import { resolve } from 'node:path';
import { vanillaExtractPlugin as vanillaExtractVitePlugin } from '@vanilla-extract/vite-plugin';
import react from '@vitejs/plugin-react-swc';
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const external = [
/^@radix-ui/,
/^react$/,
/^react\//,
/^react-dom$/,
/^react-dom\//,
'clsx',
'next-themes',
/^@blocksuite/,
];
export default defineConfig({
plugins: [
react(),
vanillaExtractVitePlugin({}),
dts({
insertTypesEntry: true,
exclude: ['**/*.stories.tsx', '**/*.test.tsx'],
}),
],
build: {
target: 'es2022',
outDir: 'dist',
minify: false,
sourcemap: true,
lib: {
entry: {
avatar: resolve(__dirname, 'src/avatar/index.ts'),
button: resolve(__dirname, 'src/button/index.ts'),
loading: resolve(__dirname, 'src/loading/index.ts'),
divider: resolve(__dirname, 'src/divider/index.ts'),
tooltip: resolve(__dirname, 'src/tooltip/index.ts'),
menu: resolve(__dirname, 'src/menu/index.ts'),
modal: resolve(__dirname, 'src/modal/index.ts'),
popover: resolve(__dirname, 'src/popover/index.ts'),
},
formats: ['es'],
},
rollupOptions: {
external,
},
},
});