Skip to content

Commit

Permalink
Print deprecation messages for custom properties in "babel" options hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Dec 5, 2016
1 parent d23a360 commit d332718
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.js
Expand Up @@ -17,6 +17,7 @@ module.exports = {
var dep = checker.for('ember-cli', 'npm');

this._shouldSetupRegistryInIncluded = !dep.satisfies('>=0.2.0');
this._shouldShowBabelDeprecations = !dep.lt('2.11.0-beta.1');
},

setupPreprocessorRegistry: function(type, registry) {
Expand All @@ -39,6 +40,12 @@ module.exports = {
if (customOptions && 'includePolyfill' in customOptions) {
return customOptions.includePolyfill === true;
} else if (babelOptions && 'includePolyfill' in babelOptions) {
if (this._shouldShowBabelDeprecations && !this._polyfillDeprecationPrinted) {
this._polyfillDeprecationPrinted = true;
this.ui.writeDeprecateLine(
'Putting the "includePolyfill" option in "babel" is deprecated, please put it in "ember-cli-babel" instead.');
}

return babelOptions.includePolyfill === true;
} else {
return false;
Expand Down Expand Up @@ -94,6 +101,12 @@ module.exports = {
if (customOptions && 'compileModules' in customOptions) {
compileModules = customOptions.compileModules === true;
} else if ('compileModules' in options) {
if (this._shouldShowBabelDeprecations && !this._modulesDeprecationPrinted) {
this._modulesDeprecationPrinted = true;
this.ui.writeDeprecateLine(
'Putting the "compileModules" option in "babel" is deprecated, please put it in "ember-cli-babel" instead.');
}

compileModules = options.compileModules === true;
} else {
compileModules = false;
Expand Down

0 comments on commit d332718

Please sign in to comment.