From a3cd0868d8a575a8e7c345ddf03b770d1ee6279d Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Wed, 12 Sep 2018 17:54:00 +0900 Subject: [PATCH] fix(babel7): do not load root .babelrc (#61) * Do not load root .babelrc * Update index.js * Update index.js --- src/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index ae624c4..3f4d634 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,17 @@ function prevalPlugin(babel) { comments.find(isPrevalComment).value = ' this file was prevaled' - const {code: string} = transformFromAst(path.node) + const {code: string} = transformFromAst( + path.node, + null, + /* istanbul ignore next (babel 6 vs babel 7 check) */ + /^6\./.test(babel.version) + ? {} + : { + babelrc: false, + configFile: false, + }, + ) const replacement = getReplacement({string, fileOpts, babel}) const moduleExports = Object.assign(