-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mts
38 lines (37 loc) · 1.02 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
import react from '@vitejs/plugin-react'
import { nodeExternals } from 'rollup-plugin-node-externals'
import preserveDirectives from 'rollup-plugin-preserve-directives'
import { defineConfig } from 'vite'
import checker from 'vite-plugin-checker'
import dts from 'vite-plugin-dts'
export default defineConfig({
build: {
target: 'es6',
outDir: 'lib',
lib: {
entry: ['src/index.ts'],
fileName: (format, entryName) => (format === 'es' ? `${entryName}.mjs` : `${entryName}.js`),
formats: ['es', 'cjs'],
},
rollupOptions: {
plugins: [nodeExternals()],
output: {
interop: 'auto',
preserveModules: true,
preserveModulesRoot: 'src',
},
},
minify: false,
},
plugins: [
checker({ typescript: { tsconfigPath: './tsconfig.build.json' } }),
dts({ tsconfigPath: './tsconfig.build.json' }),
react({
jsxImportSource: '@emotion/react',
babel: {
plugins: ['@emotion/babel-plugin'],
},
}),
preserveDirectives(),
],
})