Skip to content

Commit

Permalink
fix: trigger custom babel when e-c-ts >= 4.0 is found
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescdavis committed Sep 17, 2020
1 parent 2842a34 commit 701009a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/compat/src/v1-addon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 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
Expand Down

0 comments on commit 701009a

Please sign in to comment.