-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
52 lines (50 loc) · 1.01 KB
/
vite.config.js
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 path from 'path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
export default defineConfig({
build: {
lib: {
entry: path.resolve(__dirname, 'src/index.ts'),
name: '@sonwonjae/react-markdownarea',
fileName: (format) => {
return `index.${format}.js`;
},
},
rollupOptions: {
external: ['react', 'react-dom'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
},
outDir: 'lib',
sourcemap: true,
emptyOutDir: true,
},
plugins: [
react(),
dts({
/** NOTE: build 시 필요없는 파일 제외 */
exclude: [
'node_modules',
'src/app',
'**/*.config.ts',
'**/*.config.js',
'**/*.config.mjs',
'**/prettierrc.base.js',
'next-env.d.ts',
'.next/types/**/*.ts',
// NOTE: test tool 제외
'cypress',
'**/*.cy.ts',
'**/*.cy.tsx',
],
}),
],
resolve: {
alias: [{ find: '@', replacement: path.resolve(__dirname, 'src') }],
},
});