Skip to content

Commit

Permalink
Using a config to include ember-data/debug in the build
Browse files Browse the repository at this point in the history
  • Loading branch information
pliljegr authored and Peter Liljegren committed Nov 5, 2019
1 parent 72b45b5 commit 636ff49
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/debug/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,19 @@ module.exports = Object.assign({}, addonBaseConfig, {
externalDependenciesForPrivateModule() {
return [];
},
isEnabled() {
const { hasOwnProperty } = Object.prototype;
const config = this.parent.config(this.app.env);
const userDefinedProperty = hasOwnProperty.call(config, 'includeDebug');
if (userDefinedProperty) {
// use the user defined property from environment.js
return config.includeDebug;
} else if (config.APP.name && config.APP.name === 'ember-data') {
// include this by 'default' for the main addon
return true;
} else {
// do not include this by default
return false;
}
},
});

0 comments on commit 636ff49

Please sign in to comment.