Skip to content

Commit

Permalink
Merge pull request #1343 from bertdeblock/fix-babel-core-version-check
Browse files Browse the repository at this point in the history
Fix `@babel/core` version check to support `ember-cli-babel` v8
  • Loading branch information
ef4 authored Feb 1, 2023
2 parents b490776 + 1b00ac0 commit e1c5b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/compat/src/v1-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ export default class V1App {
let babelAddon = this.app.project.addons.find((a: any) => a.name === 'ember-cli-babel');
if (babelAddon) {
let babelAddonMajor = Number(babelAddon.pkg.version.split('.')[0]);
let babelMajor = babelAddonMajor;
let babelMajor: number | undefined = babelAddonMajor;
if (babelAddonMajor >= 8) {
// `ember-cli-babel` v8 breaks lockstep with Babel, because it now
// defines `@babel/core` as a peer dependency, so we need to check the
// project's version of `@babel/core`:
let babelVersion = this.app.project.pkg.devDependencies?.['@babel/core'];
if (babelVersion) {
babelMajor = Number(babelVersion.split('.')[0]);
babelMajor = semver.coerce(babelVersion)?.major;
} else {
babelMajor = 7;
}
Expand Down

0 comments on commit e1c5b45

Please sign in to comment.