diff --git a/rollup.config.mjs b/rollup.config.mjs index 6c8117b7f..5acac763c 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -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: [