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

Commit

Permalink
Fix Babel backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
crisptrutski committed Apr 9, 2015
1 parent 02c2255 commit ea0eeb7
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions compilers/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ exports.remap = remap;

// load the transpiler module with the plugin loader
exports.attach = function(loader) {
// NB for better performance, we should just parse and
// NB for better performance, we should just parse and
// cache the AST and store on the metadata, returning the deps only
var loaderTranspile = loader.transpile;
loader.transpile = function(load) {
return loaderTranspile.call(this.pluginLoader || this, load);
}
}
};
};

exports.compile = function(load, opts, loader) {
var normalize = opts.normalize;
Expand Down Expand Up @@ -102,11 +102,10 @@ exports.compile = function(load, opts, loader) {
options.moduleIds = true;
options.externalHelpers = true;

// Babel 4
options.returnUsedHelpers = true;

// Babel 5
options.metadataUsedHelpers = true;
if (babel.version.match(/^4/))
options.returnUsedHelpers = true;
else
options.metadataUsedHelpers = true;

if (normalize)
options.resolveModuleSource = function(dep) {
Expand Down

0 comments on commit ea0eeb7

Please sign in to comment.