Skip to content

Commit

Permalink
Merge pull request #529 from jamescdavis/e-c-ts-4-addon-fix
Browse files Browse the repository at this point in the history
Fix for addons using ember-cli-typescript 4x
  • Loading branch information
ef4 authored Sep 17, 2020
2 parents a3ff196 + a6567f2 commit e21b186
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 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
Expand Down

0 comments on commit e21b186

Please sign in to comment.