Skip to content

Commit

Permalink
Strip FeatureFlagged code in non canary builds
Browse files Browse the repository at this point in the history
  • Loading branch information
igorT committed Nov 14, 2019
1 parent 738ad85 commit d909401
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/private-build-infra/src/features.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
'use strict';

function isCanary() {
const version = require('../package.json').version;
return version.indexOf('alpha') !== -1;
}
const version = require('../package.json').version;
const isCanary = version.includes('alpha');

const requireEsm = require('esm')(module);
function getFeatures() {
const { default: features } = requireEsm('@ember-data/canary-features/addon/default-features.ts');

if (!isCanary) {
for (let feature in features) {
let featureValue = features[feature];

if (featureValue === null) {
features[feature] = false;
}
}
return features;
}

Expand Down

0 comments on commit d909401

Please sign in to comment.