mirror of https://github.com/status-im/metro.git
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
85c016df31
commit
db91ff81fd
|
@ -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