File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed
Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 4545 "agent-base" : " ^6.0.2" ,
4646 "socks" : " ^2.8.7"
4747 },
48+ "./HttpsProxySocket" : {
49+ "require" : " ./lib/cjs/HttpsProxySocket.cjs" ,
50+ "import" : " ./lib/esm/HttpsProxySocket.mjs"
51+ },
52+ "./tediousPatch" : {
53+ "require" : " ./lib/cjs/tediousPatch.cjs" ,
54+ "import" : " ./lib/esm/tediousPatch.mjs"
55+ },
56+ "./mongoPatch" : {
57+ "require" : " ./lib/cjs/mongoPatch.cjs" ,
58+ "import" : " ./lib/esm/mongoPatch.mjs"
59+ },
4860 "files" : [
4961 " /README.md" ,
5062 " /lib"
Original file line number Diff line number Diff line change @@ -2,10 +2,7 @@ import { execSync } from 'child_process';
22import { readdirSync , renameSync } from 'fs' ;
33import { join } from 'path' ;
44
5- // Compile ESM
65execSync ( 'tsc -p tsconfig.esm.json' , { stdio : 'inherit' } ) ;
7-
8- // Compile CJS
96execSync ( 'tsc -p tsconfig.cjs.json' , { stdio : 'inherit' } ) ;
107
118// Rename .js -> .cjs in CJS folder
@@ -18,14 +15,4 @@ readdirSync(cjsDir).forEach((file) => {
1815 }
1916} ) ;
2017
21- // Rename .js -> .mjs in ESM folder
22- const esmDir = join ( process . cwd ( ) , 'lib/esm' ) ;
23- readdirSync ( esmDir ) . forEach ( ( file ) => {
24- if ( file . endsWith ( '.js' ) ) {
25- const oldPath = join ( esmDir , file ) ;
26- const newPath = join ( esmDir , file . replace ( / \. j s $ / , '.mjs' ) ) ;
27- renameSync ( oldPath , newPath ) ;
28- }
29- } ) ;
30-
3118console . log ( '✅ Build complete: ESM (.js) + CJS (.cjs)' ) ;
You can’t perform that action at this time.
0 commit comments