-
Notifications
You must be signed in to change notification settings - Fork 114
Expand file tree
/
Copy pathvite.config.ts
More file actions
34 lines (32 loc) · 795 Bytes
/
Copy pathvite.config.ts
File metadata and controls
34 lines (32 loc) · 795 Bytes
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
import {resolve} from 'path';
import react from '@vitejs/plugin-react';
import dts from 'vite-plugin-dts';
import {defineConfig} from 'vite';
const packageJSON = require('./package.json');
export default defineConfig({
plugins: [dts({rollupTypes: true}), react()],
build: {
sourcemap: true,
lib: {
entry: resolve(__dirname, 'lib/index.ts'),
name: packageJSON.name,
formats: ['cjs', 'es'],
},
outDir: 'build',
rollupOptions: {
external: [
'react',
'react-dom',
'react/jsx-runtime',
...Object.keys(packageJSON.dependencies),
...Object.keys(packageJSON.peerDependencies),
],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM'
}
}
}
}
});