-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
40 lines (39 loc) · 1.09 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
import preserveDirectives from 'rollup-preserve-directives';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import dts from 'vite-plugin-dts';
// https://vitejs.dev/config/
export default defineConfig({
build: {
lib: {
entry: {
'force-ui': resolve(process.cwd(), 'src/index.ts'),
withTW: resolve(process.cwd(), 'src/utilities/withTW.js'),
},
name: '[name]',
fileName: '[name]',
formats: ['es', 'cjs'],
},
outDir: 'dist',
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: ['react', 'react-dom', 'react/jsx-runtime'],
},
},
resolve: {
alias: {
'@/icons': resolve(process.cwd(), 'src/ui/icons.jsx'),
'@/components': resolve(process.cwd(), 'src/components'),
'@/utilities': resolve(process.cwd(), 'src/utilities'),
'@/globals': resolve(process.cwd(), 'src/globals'),
'@': resolve(process.cwd(), 'src'),
},
},
plugins: [
react(),
dts({ rollupTypes: true, tsconfigPath: './tsconfig.app.json' }),
preserveDirectives(),
],
});