Skip to content

Commit 7477a37

Browse files
arg
1 parent c646847 commit 7477a37

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

scripts/build.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,14 @@ readdirSync(cjsDir).forEach((file) => {
1515
}
1616
});
1717

18+
// Rename .js -> .mjs in ESM folder
19+
const esmDir = join(process.cwd(), 'lib/esm');
20+
readdirSync(esmDir).forEach((file) => {
21+
if (file.endsWith('.js')) {
22+
const oldPath = join(esmDir, file);
23+
const newPath = join(esmDir, file.replace(/\.js$/, '.mjs'));
24+
renameSync(oldPath, newPath);
25+
}
26+
});
27+
1828
console.log('✅ Build complete: ESM (.js) + CJS (.cjs)');

0 commit comments

Comments
 (0)