Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit 80b4c36

Browse files
committed
only compute source maps in builder when enabled
1 parent 9ab9ac1 commit 80b4c36

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

plugin-babel.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ exports.translate = function(load, traceOpts) {
127127
load.source = 'import babelHelpers from "' + externalHelpersPath + '";' + load.source;
128128
presets.push(externalHelpers);
129129
}
130-
130+
131131
if (babelOptions.es2015)
132132
presets.push((outputESM || load.metadata.format == 'cjs') ? es2015 : es2015Register);
133133
else if (!(outputESM || load.metadata.format == 'cjs'))
@@ -172,7 +172,7 @@ exports.translate = function(load, traceOpts) {
172172
presets: presets,
173173
filename: load.address,
174174
moduleIds: false,
175-
sourceMaps: babelOptions.sourceMaps,
175+
sourceMaps: traceOpts && traceOpts.sourceMaps || babelOptions.sourceMaps,
176176
inputSourceMap: load.metadata.sourceMap,
177177
compact: babelOptions.compact,
178178
comments: babelOptions.comments,
@@ -215,4 +215,3 @@ exports.translate = function(load, traceOpts) {
215215
return output.code;
216216
});
217217
};
218-

0 commit comments

Comments
 (0)