From 526da6049467f3d2118fb7efc8614f9834ebb5eb Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 12 Mar 2021 10:35:43 +0100 Subject: [PATCH] fix: respect `inputSourceMap` loader option Currently, when the loader is invoked without a `map` object the `inputSourceMap` fallbacks to `undefined`. This caused the sourcemap to be loaded by Babel since this defaults to `true` https://babeljs.io/docs/en/options#inputsourcemap Thus, currently there is no way to disable `inputSourceMap` when using this loader. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 45f518da..41d4d46b 100644 --- a/src/index.js +++ b/src/index.js @@ -130,7 +130,7 @@ async function loader(source, inputSourceMap, overrides) { const programmaticOptions = Object.assign({}, loaderOptions, { filename, - inputSourceMap: inputSourceMap || undefined, + inputSourceMap: inputSourceMap || loaderOptions.inputSourceMap, // Set the default sourcemap behavior based on Webpack's mapping flag, // but allow users to override if they want.