Skip to content

Commit

Permalink
Merge pull request avajs#147 from uiureo/fix-espower-babel
Browse files Browse the repository at this point in the history
Use local babel in babel-plugin-espower
  • Loading branch information
sindresorhus committed Nov 7, 2015
2 parents 4f5597d + 18619fc commit 5910c6b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ var requireFromString = require('require-from-string');
var hasGenerators = parseInt(process.version.slice(1), 10) > 0;
var path = process.argv[2];

var options = {
blacklist: hasGenerators ? ['regenerator'] : [],
optional: hasGenerators ? ['asyncToGenerator', 'runtime'] : ['runtime'],
plugins: [
createEspowerPlugin(require('babel-core'), {
patterns: require('./enhance-assert').PATTERNS
})
]
};

var babel;

try {
Expand All @@ -24,5 +14,15 @@ try {
babel = require('babel-core');
}

var options = {
blacklist: hasGenerators ? ['regenerator'] : [],
optional: hasGenerators ? ['asyncToGenerator', 'runtime'] : ['runtime'],
plugins: [
createEspowerPlugin(babel, {
patterns: require('./enhance-assert').PATTERNS
})
]
};

var transpiled = babel.transformFileSync(path, options);
requireFromString(transpiled.code, path);

0 comments on commit 5910c6b

Please sign in to comment.