From 804bc90e34a9ac094d010d8eb827f3822a006b0b Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Tue, 26 Oct 2021 18:01:58 -0400 Subject: [PATCH] Ensure babel.parse does not use top level babel config. 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. --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 700b3d67..cca75317 100644 --- a/index.js +++ b/index.js @@ -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;