mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Use lazyFinalizer function when calling addJavaScript in BabelCompiler.
This commit is contained in:
@@ -21,15 +21,29 @@ var hasOwn = Object.prototype.hasOwnProperty;
|
||||
var isMeteorPre144 = semver.lt(process.version, "4.8.1");
|
||||
|
||||
BCp.processFilesForTarget = function (inputFiles) {
|
||||
var compiler = this;
|
||||
|
||||
// Reset this cache for each batch processed.
|
||||
this._babelrcCache = null;
|
||||
|
||||
inputFiles.forEach(function (inputFile) {
|
||||
var toBeAdded = this.processOneFileForTarget(inputFile);
|
||||
if (toBeAdded) {
|
||||
inputFile.addJavaScript(toBeAdded);
|
||||
var fileOptions = inputFile.getFileOptions();
|
||||
|
||||
if (inputFile.supportsLazyCompilation) {
|
||||
inputFile.addJavaScript({
|
||||
path: inputFile.getPathInPackage(),
|
||||
hash: inputFile.getSourceHash(),
|
||||
bare: !! fileOptions.bare
|
||||
}, function () {
|
||||
return compiler.processOneFileForTarget(inputFile);
|
||||
});
|
||||
} else {
|
||||
var toBeAdded = compiler.processOneFileForTarget(inputFile);
|
||||
if (toBeAdded) {
|
||||
inputFile.addJavaScript(toBeAdded);
|
||||
}
|
||||
}
|
||||
}, this);
|
||||
});
|
||||
};
|
||||
|
||||
// Returns an object suitable for passing to inputFile.addJavaScript, or
|
||||
|
||||
Reference in New Issue
Block a user