Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Ensure babel.parse does not use top level babel config.
Browse files Browse the repository at this point in the history
Without this, using `babel.config.js` (as introduced in ember-cli-babel
>= 7.24.0) for babel configuration with certain presets (e.g.
`@babel/preset-typescript`) throws an error.
  • Loading branch information
rwjblue committed Oct 26, 2021
1 parent acfc136 commit 804bc90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ module.exports = function (babel) {
precompileResultString = precompile(template, options);
}

let precompileResultAST = babel.parse(`var precompileResult = ${precompileResultString};`);
let precompileResultAST = babel.parse(`var precompileResult = ${precompileResultString};`, {
babelrc: false,
configFile: false,
});

let templateExpression = precompileResultAST.program.body[0].declarations[0].init;

Expand Down

0 comments on commit 804bc90

Please sign in to comment.