Skip to content

Commit

Permalink
Fix @babel/core@7.0.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Mar 9, 2022
1 parent d1c7ee5 commit 51439df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/babel-helpers/src/index.ts
Expand Up @@ -271,7 +271,11 @@ function loadHelper(name: string) {
const fn = (): File => {
if (!process.env.BABEL_8_BREAKING) {
if (!FileClass) {
return { ast: file(helper.ast()) } as File;
const fakeFile = { ast: file(helper.ast()), path: null } as File;
traverse(fakeFile.ast, {
Program: path => (fakeFile.path = path).stop(),
});
return fakeFile;
}
}
return new FileClass(
Expand Down

0 comments on commit 51439df

Please sign in to comment.