File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
playgrounds/standalone-playground Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,18 @@ const { defineConfig } = require('tsup')
22
33module . exports = defineConfig ( ( ) => ( {
44 entry : [ 'src/index.ts' ] ,
5- format : [ 'esm' , 'cjs' ] ,
5+ format : [ 'esm' , 'cjs' ] , // Output both ESM and CJS formats
66 dts : {
77 resolve : true ,
88 entry : 'src/index.ts' ,
99 } ,
10- outDir : 'dist' ,
1110 clean : true ,
11+ esbuildOptions ( options , context ) {
12+ if ( context . format === 'esm' ) {
13+ options . outdir = 'dist/esm' // Output ESM files to dist/esm
14+ options . outExtension = { '.js' : '.mjs' } // Use .mjs for ESM files
15+ } else if ( context . format === 'cjs' ) {
16+ options . outdir = 'dist/cjs' // Output CJS files to dist/cjs
17+ }
18+ } ,
1219} ) )
Original file line number Diff line number Diff line change 77 "directory" : " packages/page-tools"
88 },
99 "license" : " MIT" ,
10- "module" : " ./dist/index.mjs" ,
11- "types " : " ./dist/index.d.mts " ,
12- "main " : " ./dist/index.js " ,
10+ "module" : " ./dist/esm/ index.mjs" ,
11+ "main " : " ./dist/cjs/ index.js " ,
12+ "types " : " ./dist/index.d.ts " ,
1313 "sideEffects" : false ,
1414 "files" : [
1515 " LICENSE" ,
Original file line number Diff line number Diff line change 77 "scripts" : {
88 "." : " yarn run -T turbo run --filter=@playground/standalone-playground..." ,
99 "start" : " yarn http-server . -o /pages" ,
10- "dev" : " yarn concurrently 'yarn start' 'sleep 3 && ASSET_PATH='/node_modules/@segment/analytics-next/dist/umd/' yarn . watch'" ,
10+ "dev" : " yarn concurrently 'yarn start' 'yarn watch'" ,
11+ "watch" : " yarn concurrently 'yarn:watch:*'" ,
12+ "watch:ajs" : " ASSET_PATH='/node_modules/@segment/analytics-next/dist/umd/' yarn workspace @segment/analytics-next watch" ,
13+ "watch:signals" : " yarn workspace @segment/analytics-signals watch" ,
1114 "concurrently" : " yarn run -T concurrently"
1215 },
1316 "dependencies" : {
You can’t perform that action at this time.
0 commit comments