diff --git a/tests/app-template/babel.config.cjs b/tests/app-template/babel.config.cjs index b5a817ba04..b6364b50a7 100644 --- a/tests/app-template/babel.config.cjs +++ b/tests/app-template/babel.config.cjs @@ -1,4 +1,16 @@ // eslint-disable-next-line n/no-missing-require -let config = require("./node_modules/.embroider/rewritten-app/_babel_config_"); + +let config; + +// TODO - remove this once we have the better solution for injecting stage1 babel config into a real config file +// this is needed because there are things (like ember-composible-helpers) that are now finding our babel config during +// their stage1 build and historically they will never (99% of the time) have found any babel config. +// we might need to keep something like this so that prebuild will never apply babel configs during stage1 i.e. a util +// function that wraps your whole babel config +if (process.env.EMBROIDER_PREBUILD) { + config = {}; +} else { + config = require("./node_modules/.embroider/rewritten-app/_babel_config_"); +} module.exports = config; diff --git a/tests/ts-app-template/babel.config.cjs b/tests/ts-app-template/babel.config.cjs index 010f4197f6..73559994de 100644 --- a/tests/ts-app-template/babel.config.cjs +++ b/tests/ts-app-template/babel.config.cjs @@ -1,6 +1,16 @@ // eslint-disable-next-line n/no-missing-require -let config = require('./node_modules/.embroider/rewritten-app/_babel_config_'); -debugger; +let config; + +// TODO - remove this once we have the better solution for injecting stage1 babel config into a real config file +// this is needed because there are things (like ember-composible-helpers) that are now finding our babel config during +// their stage1 build and historically they will never (99% of the time) have found any babel config. +// we might need to keep something like this so that prebuild will never apply babel configs during stage1 i.e. a util +// function that wraps your whole babel config +if (process.env.EMBROIDER_PREBUILD) { + config = {}; +} else { + config = require('./node_modules/.embroider/rewritten-app/_babel_config_'); +} module.exports = config;