Skip to content

Commit fbaa362

Browse files
committed
fix esmify not to convert tslib to tslib.mjs
1 parent ad9c290 commit fbaa362

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/esmify.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ for (const file of files) {
1010
console.info(`Processing ${file} => ${fileMjs}`);
1111
// .js => .mjs
1212
const content = fs.readFileSync(file).toString("utf-8");
13-
const newContent = content.replace(/\bfrom "([^"]+)";/g, 'from "$1.mjs";')
13+
const newContent = content.replace(/\bfrom "(\.\.?\/[^"]+)";/g, 'from "$1.mjs";')
1414
.replace(/\/\/# sourceMappingURL=(.+)\.js\.map$/,
1515
"//# sourceMappingURL=$1.mjs.map");
1616
fs.writeFileSync(fileMjs, newContent);

0 commit comments

Comments
 (0)