File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1717 " dist"
1818 ],
1919 "scripts" : {
20- "build" : " tsup src/index.tsx --format esm,cjs --dts " ,
21- "dev" : " tsup src/index.tsx --watch --format esm,cjs " ,
20+ "build" : " tsup" ,
21+ "dev" : " tsup --watch" ,
2222 "test" : " vitest run" ,
2323 "clean" : " rm -rf dist" ,
2424 "prepare" : " pnpm build" ,
Original file line number Diff line number Diff line change 22 "compilerOptions" : {
33 "target" : " ES2020" ,
44 "module" : " ESNext" ,
5- "moduleResolution" : " Node " ,
5+ "moduleResolution" : " bundler " ,
66 "lib" : [" DOM" , " ES2020" ],
77 "types" : [" vitest/globals" ],
88 "allowJs" : true ,
Original file line number Diff line number Diff line change 1+ import { defineConfig } from 'tsup' ;
2+ import pkg from './package.json' ;
3+
4+ export default defineConfig ( ( options ) => ( {
5+ export default defineConfig ( ( options ) => ( {
6+ entry : [ 'src/index.tsx' ] ,
7+ format : [ 'esm' , 'cjs' ] ,
8+ outExtension : ext => ( {
9+ esm : '.mjs' ,
10+ cjs : '.cjs' ,
11+ } ) ,
12+ dts : true ,
13+ watch : options . watch ,
14+ clean : true ,
15+ } ) ) ;
16+ banner : {
17+ js : `/**
18+ * ${ pkg . name } v${ pkg . version }
19+ * Author: ${ pkg . author }
20+ */
21+ ` ,
22+ } ,
23+ } ) ) ;
You can’t perform that action at this time.
0 commit comments