From 4bdec90f48e5078b042f96bb621e7daffe8c5d87 Mon Sep 17 00:00:00 2001 From: "James C. Davis" Date: Wed, 16 Sep 2020 05:03:21 -0400 Subject: [PATCH] fix: trigger custom babel when e-c-ts >= 4.0 is found --- packages/compat/src/v1-addon.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/compat/src/v1-addon.ts b/packages/compat/src/v1-addon.ts index e6bcee60fc..8307fd1d80 100644 --- a/packages/compat/src/v1-addon.ts +++ b/packages/compat/src/v1-addon.ts @@ -199,6 +199,18 @@ export default class V1Addon { } private needsCustomBabel() { + if ( + this.addonInstance.addons.find( + (a: any) => + a.name === 'ember-cli-typescript' && + semver.satisfies(semver.coerce(a.pkg.version) || a.pkg.version, '>=4.0.0-alpha.1') + ) + ) { + // This addon is using ember-cli-typescript 4, which relies on + // ember-cli-babel to add the TypeScript transform Babel plugin. + //return true; + } + let babelConfig = this.options.babel as TransformOptions | undefined; if (babelConfig && babelConfig.plugins && babelConfig.plugins.length > 0) { // this addon has custom babel plugins, so we need to run them here in