From c622868020a07cc4d632bb51afb3db1f4edaaae2 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 14 Apr 2022 16:20:36 +0200 Subject: [PATCH] fix: respect `inputSourceMap` loader option (#896) 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.