From 6d3aa1ae79f103ab0c9644653bed7ac5cf04658b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Pintos=20L=C3=B3pez?= Date: Tue, 3 Dec 2024 16:56:44 +0100 Subject: [PATCH] fix: update rollup config to patch wrong sourcemap links on ESM build --- rollup.config.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) 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: [