generated from Clarkkkk/vite-vanilla-ts-lib-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
32 lines (31 loc) · 871 Bytes
/
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
/// <reference types="vitest" />
import path from 'path'
import { nodeExternals } from 'rollup-plugin-node-externals'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
export default defineConfig(({ mode }) => {
return {
base: './',
build: {
lib: {
entry: {
index: path.resolve(__dirname, 'src/index.ts')
},
formats: ['cjs', 'es']
}
},
plugins:
mode === 'test'
? []
: [
dts(),
{
...nodeExternals({
deps: true,
devDeps: true
}),
enforce: 'pre'
}
]
}
})