Skip to content

Commit a3cd086

Browse files
ykztsKent C. Dodds
authored andcommitted
fix(babel7): do not load root .babelrc (#61)
* Do not load root .babelrc * Update index.js * Update index.js
1 parent b0f94b9 commit a3cd086

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ function prevalPlugin(babel) {
2727

2828
comments.find(isPrevalComment).value = ' this file was prevaled'
2929

30-
const {code: string} = transformFromAst(path.node)
30+
const {code: string} = transformFromAst(
31+
path.node,
32+
null,
33+
/* istanbul ignore next (babel 6 vs babel 7 check) */
34+
/^6\./.test(babel.version)
35+
? {}
36+
: {
37+
babelrc: false,
38+
configFile: false,
39+
},
40+
)
3141
const replacement = getReplacement({string, fileOpts, babel})
3242

3343
const moduleExports = Object.assign(

0 commit comments

Comments
 (0)