File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1212 "exports" : {
1313 "." : {
1414 "types" : " ./dist/index.d.ts" ,
15+ "node" : " ./dist/index.js" ,
1516 "import" : " ./dist/index.mjs" ,
1617 "require" : " ./dist/index.js" ,
1718 "default" : " ./dist/index.js"
Original file line number Diff line number Diff line change 11import path from 'path' ;
22import { defineConfig } from 'tsup' ;
3+ import pkg from './package.json' ;
34
45const env = process . env . NODE_ENV ;
56
7+ // All deps and peerDeps must stay external — re-bundling packages like
8+ // MUI / emotion breaks CJS ↔ ESM default-export interop at runtime.
9+ const external = [
10+ ...Object . keys ( pkg . dependencies ?? { } ) ,
11+ ...Object . keys ( pkg . peerDependencies ?? { } )
12+ ] ;
13+
614export default defineConfig ( {
715 outDir : 'dist' ,
816 entry : [ 'src/index.tsx' ] ,
917 bundle : env === 'production' ,
1018 clean : true ,
1119 dts : true ,
1220 format : [ 'cjs' , 'esm' ] ,
13- external : [
14- 'react' ,
15- 'react-dom' ,
16- 'xstate' ,
17- '@xstate/react' ,
18- 'mui-datatables' ,
19- '@mui/material' ,
20- '@mui/system' ,
21- '@mui/utils' ,
22- '@mui/icons-material' ,
23- '@emotion/react' ,
24- '@emotion/styled'
25- ] ,
21+ external,
2622 minify : env === 'production' ,
2723 watch : env === 'development' ,
2824 sourcemap : env === 'development' ,
You can’t perform that action at this time.
0 commit comments