Skip to content

Commit

Permalink
fix esmify not to convert tslib to tslib.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
gfx committed Mar 21, 2021
1 parent ad9c290 commit fbaa362
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/esmify.ts
Expand Up @@ -10,7 +10,7 @@ for (const file of files) {
console.info(`Processing ${file} => ${fileMjs}`);
// .js => .mjs
const content = fs.readFileSync(file).toString("utf-8");
const newContent = content.replace(/\bfrom "([^"]+)";/g, 'from "$1.mjs";')
const newContent = content.replace(/\bfrom "(\.\.?\/[^"]+)";/g, 'from "$1.mjs";')
.replace(/\/\/# sourceMappingURL=(.+)\.js\.map$/,
"//# sourceMappingURL=$1.mjs.map");
fs.writeFileSync(fileMjs, newContent);
Expand Down

0 comments on commit fbaa362

Please sign in to comment.