Merge config options into list after babelrc options - fixes T7079

This commit is contained in:
Logan Smyth 2016-02-10 21:18:27 -08:00
parent 77a36633be
commit 8c910d6a4c
2 changed files with 8 additions and 14 deletions

View File

@ -401,6 +401,11 @@ export default class OptionManager {
init(opts: Object = {}): Object { init(opts: Object = {}): Object {
let filename = opts.filename; let filename = opts.filename;
// resolve all .babelrc files
if (opts.babelrc !== false) {
this.findConfigs(filename);
}
// merge in base options // merge in base options
this.mergeOptions({ this.mergeOptions({
options: opts, options: opts,
@ -408,11 +413,6 @@ export default class OptionManager {
dirname: filename && path.dirname(filename) dirname: filename && path.dirname(filename)
}); });
// resolve all .babelrc files
if (this.options.babelrc !== false) {
this.findConfigs(filename);
}
// normalise // normalise
this.normaliseOptions(opts); this.normaliseOptions(opts);

View File

@ -49,16 +49,10 @@ function mtime(filename) {
function compile(filename) { function compile(filename) {
let result; let result;
let optsManager = new OptionManager;
// merge in base options and resolve all the plugins and presets relative to this file // merge in base options and resolve all the plugins and presets relative to this file
optsManager.mergeOptions({ let opts = new OptionManager().init(extend(deepClone(transformOpts), {
options: deepClone(transformOpts), filename
alias: "base", }));
dirname: path.dirname(filename)
});
let opts = optsManager.init({ filename });
let cacheKey = `${JSON.stringify(opts)}:${babel.version}`; let cacheKey = `${JSON.stringify(opts)}:${babel.version}`;