Skip to content

Commit

Permalink
Merge pull request #5239 from bmac/prod-like-warniing
Browse files Browse the repository at this point in the history
Deprecate support for "production like" values in EMBER_ENV
  • Loading branch information
pangratz authored Oct 25, 2017
2 parents 1166a54 + e4e5781 commit 2182864
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ function isProductionEnv() {
module.exports = {
name: 'ember-data',

_prodLikeWarning() {
let emberEnv = process.env.EMBER_ENV
if(emberEnv !== 'production' && /production/.test(emberEnv)) {
this._warn(`Production-like values for EMBER_ENV are deprecated (your EMBER_ENV is "${emberEnv}") and support will be removed in Ember Data 4.0.0. If using ember-cli-deploy, please configure your build using 'production'. Otherwise please set your EMBER_ENV to 'production' for production builds.`);
}
},

_warn(message) {
let chalk = require('chalk');
let warning = chalk.yellow('WARNING: ' + message);
Expand All @@ -53,7 +60,7 @@ module.exports = {

init() {
this._super.init && this._super.init.apply(this, arguments);

this._prodLikeWarning();
this.debugTree = BroccoliDebug.buildDebugCallback('ember-data');

let bowerDeps = this.project.bowerDependencies();
Expand Down

0 comments on commit 2182864

Please sign in to comment.