-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (30 loc) · 817 Bytes
/
vite.config.ts
File metadata and controls
32 lines (30 loc) · 817 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
import {createRequire} from 'node:module'
import {defineConfig} from 'vite'
import dts from 'vite-plugin-dts'
const require = createRequire(import.meta.url)
const packageJson = require('./package.json')
export default defineConfig({
build: {
outDir: 'dist',
lib: {
entry: 'src/index.ts',
formats: ['es'],
fileName: () => 'index.js',
},
sourcemap: true,
rollupOptions: {
external: [
...Object.keys(packageJson.peerDependencies || {}),
'react/jsx-runtime',
],
},
},
plugins: [
dts({
entryRoot: 'src',
outDir: 'dist',
insertTypesEntry: true,
exclude: ['playground/**', 'vite.config.ts'],
}),
],
})