Skip to content

Commit

Permalink
fix: esm build source mapping url replacement (#6368)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Lu <[email protected]>
  • Loading branch information
oedotme and LFDanLu authored May 16, 2024
1 parent e16aa4d commit d7f78e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/buildEsm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs');
const glob = require('glob');

let pkg = process.argv[process.argv.length - 1];
let regex = /(.*)\.module\.js/g;
let regex = /(.*)\.module\.js(?!.map)/g;
if (fs.existsSync(`${pkg}/dist/module.js`)) {
let js = fs.readFileSync(`${pkg}/dist/module.js`, 'utf8');
js = js.replace(regex, '$1.mjs');
Expand Down

1 comment on commit d7f78e8

@rspbot
Copy link

@rspbot rspbot commented on d7f78e8 May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.