-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.mts
52 lines (50 loc) · 1.09 KB
/
vite.config.mts
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
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import dts from 'vite-plugin-dts';
import { externalizeDeps } from 'vite-plugin-externalize-deps';
import pkg from './package.json';
/**
* vite config
* @see https://vitejs.dev/
*/
export default defineConfig({
plugins: [
checker({
typescript: true,
}),
externalizeDeps(),
dts({
outDir: './dist-types',
}),
],
define: {
'process.env.PKG_NAME': JSON.stringify(pkg.name),
'process.env.PKG_VERSION': JSON.stringify(pkg.version),
},
build: {
sourcemap: false,
copyPublicDir: false,
reportCompressedSize: false,
lib: {
entry: ['src/index.ts'],
},
rollupOptions: {
output: [
{
format: 'esm',
dir: 'dist',
exports: 'named',
entryFileNames: '[name].mjs',
chunkFileNames: '[name].mjs',
},
{
format: 'cjs',
dir: 'dist',
exports: 'named',
entryFileNames: '[name].cjs',
chunkFileNames: '[name].cjs',
},
],
},
},
});