Skip to content

Commit

Permalink
fix: respect inputSourceMap loader option
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alan-agius4 committed Apr 14, 2022
1 parent f7982c1 commit 526da60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -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.
Expand Down

0 comments on commit 526da60

Please sign in to comment.