From b2091f03ef695f3fc4a792ca872aff4cd8b0fd03 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Thu, 28 Mar 2024 10:07:40 +0100 Subject: [PATCH] Fix sourcemap generation in webpack react-docgen-loader --- .../presets/react-webpack/src/loaders/react-docgen-loader.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/presets/react-webpack/src/loaders/react-docgen-loader.ts b/code/presets/react-webpack/src/loaders/react-docgen-loader.ts index 15b71f19bfd5..ac83e37982de 100644 --- a/code/presets/react-webpack/src/loaders/react-docgen-loader.ts +++ b/code/presets/react-webpack/src/loaders/react-docgen-loader.ts @@ -114,7 +114,10 @@ export default async function reactDocgenLoader( } }); - const map = magicString.generateMap({ hires: true }); + const map = magicString.generateMap({ + includeContent: true, + source: this.resourcePath, + }); callback(null, magicString.toString(), map); } catch (error: any) { if (error.code === ERROR_CODES.MISSING_DEFINITION) {