Set babelrc:false on config load for more consistent loading.

This commit is contained in:
Logan Smyth 2017-11-09 12:06:08 -08:00
parent 2bfa2eb5cd
commit 4a5d551370
2 changed files with 6 additions and 10 deletions

View File

@ -120,6 +120,7 @@ class OptionManager {
// Tack the passes onto the object itself so that, if this object is passed back to Babel a second time,
// it will be in the right structure to not change behavior.
opts.babelrc = false;
opts.plugins = this.passes[0];
opts.presets = this.passes
.slice(1)

View File

@ -63,16 +63,11 @@ function compile(code, filename) {
}
}
const result = babel.transform(
code,
Object.assign(opts, {
// Do not process config files since has already been done with the OptionManager
// calls above and would introduce duplicates.
babelrc: false,
sourceMaps: opts.sourceMaps === undefined ? "both" : opts.sourceMaps,
ast: false,
}),
);
const result = babel.transform(code, {
...opts,
sourceMaps: opts.sourceMaps === undefined ? "both" : opts.sourceMaps,
ast: false,
});
if (cache) {
cache[cacheKey] = result;