-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
64 lines (63 loc) · 2.31 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
61
62
63
64
import { resolve } from 'path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import svgr from 'vite-plugin-svgr';
import tsConfigPaths from 'vite-tsconfig-paths';
import * as packageJson from './package.json';
// TODO: build styles for components individually and add multiple entry points to package.json file
export default defineConfig(() => ({
plugins: [
react(),
svgr({
exportAsDefault: true,
}),
tsConfigPaths(),
dts({
exclude: ['**/*.test.{ts,tsx}', '**/test/**', '**/*.stories.{ts,tsx}'],
}),
],
resolve: {
alias: {
'@': resolve(__dirname, './src'),
'@assets': resolve(__dirname, './src/assets'),
'@components': resolve(__dirname, './src/components'),
'@common': resolve(__dirname, './src/common'),
},
},
build: {
lib: {
// TODO: generate it automatically
entry: {
index: resolve('src', 'components'),
themeProvider: resolve('src', 'components', 'themeProvider'),
button: resolve('src', 'components', 'button'),
checkbox: resolve('src', 'components', 'checkbox'),
systemMessage: resolve('src', 'components', 'systemMessage'),
fieldText: resolve('src', 'components', 'fieldText'),
modal: resolve('src', 'components', 'modal'),
dropdown: resolve('src', 'components', 'dropdown'),
toggle: resolve('src', 'components', 'toggle'),
baseIconButton: resolve('src', 'components', 'icons', 'baseIconButton'),
fieldNumber: resolve('src', 'components', 'fieldNumber'),
bubblesLoader: resolve('src', 'components', 'bubblesLoader'),
tooltip: resolve('src', 'components', 'tooltip'),
popover: resolve('src', 'components', 'popover'),
radio: resolve('src', 'components', 'radio'),
fieldTextFlex: resolve('src', 'components', 'fieldTextFlex'),
pagination: resolve('src', 'components', 'pagination'),
table: resolve('src', 'components', 'table'),
datePicker: resolve('src', 'components', 'datePicker'),
},
name: 'ui-kit',
formats: ['es'],
},
rollupOptions: {
external: [
...Object.keys(packageJson.dependencies),
...Object.keys(packageJson.peerDependencies),
'react/jsx-runtime',
],
},
},
}));