diff --git a/plugin/index.js b/plugin/index.js index 504dc7a76f5..c3a928c3ace 100644 --- a/plugin/index.js +++ b/plugin/index.js @@ -204,7 +204,9 @@ function buildWorkletString(t, fun, closureVariables, name, inputMap) { const code = generate(workletFunction).code; - if (shouldGenerateSourceMap()) { + const includeSourceMap = shouldGenerateSourceMap(); + + if (includeSourceMap) { // Clear contents array (should be empty anyways) inputMap.sourcesContent = []; // Include source contents in source map, because Flipper/iframe is not @@ -216,8 +218,6 @@ function buildWorkletString(t, fun, closureVariables, name, inputMap) { } } - const includeSourceMap = shouldGenerateSourceMap(); - const transformed = transformSync(code, { plugins: [prependClosureVariablesIfNecessary()], compact: !includeSourceMap,