Skip to content

Commit

Permalink
only warn for root apps/addons
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Garrett committed Mar 27, 2019
1 parent 520190f commit 80e42a4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,11 @@ module.exports = {
hasPlugin(target, '@babel/plugin-proposal-decorators')
|| hasPlugin(target, '@babel/plugin-proposal-class-properties')
) {
this.project.ui.writeWarnLine(`${
this._parentName()
} has added the decorators and/or class properties plugins to its build, but ember-cli-babel provides these by default now! You can remove the transforms, or the addon that provided them, such as @ember-decorators/babel-transforms. Ember supports the stage 1 decorator spec and transforms, so if you were using stage 2, you'll need to ensure that your decorators are compatible, or convert them to stage 1.`);
if (this.parent === this.project) {
this.project.ui.writeWarnLine(`${
this._parentName()
} has added the decorators and/or class properties plugins to its build, but ember-cli-babel provides these by default now! You can remove the transforms, or the addon that provided them, such as @ember-decorators/babel-transforms. Ember supports the stage 1 decorator spec and transforms, so if you were using stage 2, you'll need to ensure that your decorators are compatible, or convert them to stage 1.`);
}
} else {
plugins.push([require.resolve('@babel/plugin-proposal-decorators'), { legacy: true }]);
plugins.push([require.resolve('@babel/plugin-proposal-class-properties'), { loose: true }]);
Expand Down

0 comments on commit 80e42a4

Please sign in to comment.