-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
30 lines (29 loc) · 836 Bytes
/
vite.config.ts
File metadata and controls
30 lines (29 loc) · 836 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
import { defineConfig } from 'vite';
import { resolve } from 'path';
import react from '@vitejs/plugin-react';
import { peerDependencies } from './package.json';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
jsxRuntime: 'classic',
}),
],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'src', 'index.ts'),
name: 'react-paper',
formats: ['es', 'cjs'],
// the proper extensions will be added
fileName: (ext) => `index.${ext === 'cjs' ? 'cjs' : 'es.js'}`,
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
// into your library
external: [...Object.keys(peerDependencies)],
},
target: 'esnext',
sourcemap: true,
},
});