Skip to content

Commit

Permalink
fix babel config file during prebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Mar 21, 2024
1 parent 2968c5f commit 28b51a1
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
14 changes: 13 additions & 1 deletion tests/app-template/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -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;
14 changes: 12 additions & 2 deletions tests/ts-app-template/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 28b51a1

Please sign in to comment.