Skip to content

Commit

Permalink
fix: update rollup config to patch wrong sourcemap links on ESM build
Browse files Browse the repository at this point in the history
  • Loading branch information
notaphplover committed Dec 3, 2024
1 parent d9369ee commit 6d3aa1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export default [
dir: './lib/esm',
format: 'esm',
sourcemap: true,
sourcemapPathTransform: (relativeSourcePath) => {
// Rollup seems to generate source maps pointing to the wrong directory. Ugly patch to fix it
if (relativeSourcePath.startsWith('../')) {
return relativeSourcePath.slice(3);
} else {
return relativeSourcePath;
}
},
},
],
plugins: [
Expand Down

0 comments on commit 6d3aa1a

Please sign in to comment.