Bail internal transforms if there're no transforms to run
Reviewed By: sam-swarr Differential Revision: D2810474 fb-gh-sync-id: d5ba48922c91c3dbacfccb0d087cc1deac14fa1c
This commit is contained in:
parent
b75c939d59
commit
7bb60449bd
|
@ -15,6 +15,14 @@ var Transforms = require('../transforms');
|
|||
// transforms should be run after the external ones to ensure that they run on
|
||||
// Javascript code
|
||||
function internalTransforms(sourceCode, filename, options) {
|
||||
var plugins = Transforms.getAll(options);
|
||||
if (plugins.length === 0) {
|
||||
return {
|
||||
code: sourceCode,
|
||||
filename: filename,
|
||||
};
|
||||
}
|
||||
|
||||
var result = babel.transform(sourceCode, {
|
||||
retainLines: true,
|
||||
compact: true,
|
||||
|
@ -22,7 +30,7 @@ function internalTransforms(sourceCode, filename, options) {
|
|||
filename: filename,
|
||||
sourceFileName: filename,
|
||||
sourceMaps: false,
|
||||
plugins: Transforms.getAll(options)
|
||||
plugins: plugins,
|
||||
});
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in New Issue