-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.lib.config.ts
59 lines (58 loc) · 1.11 KB
/
vite.lib.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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react'
export default defineConfig({
resolve: {
alias: [
{
find: '@',
replacement: resolve(__dirname, 'src'),
},
],
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './test.setup.ts',
coverage: {
provider: 'istanbul',
},
},
build: {
target: 'es2015',
lib: {
entry: [
'src/WebBuilder.tsx',
'src/View.tsx',
'src/components/View/Box/useBoxStyle.ts',
'src/components/View/Box/Box.tsx',
'src/components.tsx',
],
formats: ['cjs', 'es'],
},
rollupOptions: {
external: ['react', 'react-dom'],
output: {
exports: 'named',
globals: {
react: 'React',
},
},
},
},
plugins: [
react({
babel: {
plugins: [
[
'babel-plugin-styled-components',
{
displayName: false,
namespace: 'web-builder',
}
],
]
}
}),
],
});