mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Call Npm.require("meteor-babel") only when needed.
In practice, the non-isopacket version of meteor-babel is only used by the shell-server package, so this saves ~200ms of reload time.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
var meteorBabel = Npm.require('meteor-babel');
|
||||
|
||||
/**
|
||||
* Returns a new object containing default options appropriate for
|
||||
*/
|
||||
function getDefaultOptions(extraFeatures) {
|
||||
var meteorBabel = Npm.require('meteor-babel');
|
||||
|
||||
// See https://github.com/meteor/babel/blob/master/options.js for more
|
||||
// information about what the default options are.
|
||||
var options = meteorBabel.getDefaultOptions(extraFeatures);
|
||||
@@ -22,11 +22,12 @@ Babel = {
|
||||
validateExtraFeatures: Function.prototype,
|
||||
|
||||
compile: function (source, options) {
|
||||
var meteorBabel = Npm.require('meteor-babel');
|
||||
options = options || getDefaultOptions();
|
||||
return meteorBabel.compile(source, options);
|
||||
},
|
||||
|
||||
setCacheDir: function (cacheDir) {
|
||||
meteorBabel.setCacheDir(cacheDir);
|
||||
Npm.require('meteor-babel').setCacheDir(cacheDir);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user