@@ -2,18 +2,35 @@ import { defineConfig } from 'tsup';
2
2
3
3
const env = process . env . NODE_ENV ;
4
4
5
- export default defineConfig ( {
6
- splitting : true ,
7
- clean : true , // clean up the dist folder
8
- dts : true , // generate dts files
9
- format : [ 'esm' , 'cjs' ] , // generate cjs and esm files
10
- minify : true , //env === 'production',
11
- bundle : true , //env === 'production',
12
- skipNodeModulesBundle : true ,
13
- watch : env === 'development' ,
14
- target : 'esnext' ,
15
- outDir : 'dist' , //env === 'production' ? 'dist' : 'lib',
16
- entry : [ 'src/index.ts' , 'src/cli.ts' ] ,
17
- sourcemap : true ,
18
- tsconfig : 'tsconfig.build.json' , // workaround for https://github.com/egoist/tsup/issues/571#issuecomment-1760052931
19
- } ) ;
5
+ export default defineConfig ( [
6
+ {
7
+ splitting : true ,
8
+ clean : true , // clean up the dist folder
9
+ dts : true , // generate dts files
10
+ format : [ 'esm' ] , // generate cjs and esm files
11
+ minify : true , //env === 'production',
12
+ bundle : true , //env === 'production',
13
+ skipNodeModulesBundle : true ,
14
+ watch : env === 'development' ,
15
+ target : 'esnext' ,
16
+ outDir : 'dist' , //env === 'production' ? 'dist' : 'lib',
17
+ entry : [ 'src/index.ts' , 'src/cli.ts' ] ,
18
+ sourcemap : true ,
19
+ tsconfig : 'tsconfig.build.json' , // workaround for https://github.com/egoist/tsup/issues/571#issuecomment-1760052931
20
+ } ,
21
+ {
22
+ splitting : false ,
23
+ clean : true , // clean up the dist folder
24
+ dts : true , // generate dts files
25
+ format : [ 'cjs' ] , // generate cjs and esm files
26
+ minify : false , //env === 'production',
27
+ bundle : true , //env === 'production',
28
+ skipNodeModulesBundle : true ,
29
+ watch : env === 'development' ,
30
+ target : 'esnext' ,
31
+ outDir : 'dist' , //env === 'production' ? 'dist' : 'lib',
32
+ entry : [ 'src/index.ts' , 'src/cli.ts' ] ,
33
+ sourcemap : true ,
34
+ tsconfig : 'tsconfig.build.json' , // workaround for https://github.com/egoist/tsup/issues/571#issuecomment-1760052931
35
+ } ,
36
+ ] ) ;
0 commit comments