Skip to content

Commit 56a336b

Browse files
Clean up ref patching
1 parent adb144a commit 56a336b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,16 @@ async function buildPlatforms() {
258258
if (isFeatureMissingState(platformConfig.features[key])) {
259259
platformConfig.features[key].state = 'disabled';
260260
}
261-
const feature = platformConfig.features[key];
262-
feature.reference = defaultConfig.reference;
261+
let feature = platformConfig.features[key];
263262
if ('patchFeature' in feature) {
263+
feature.reference = defaultConfig.reference;
264264
console.log(`Patching feature ${key} for ${platform}`, feature.patchFeature, JSON.stringify(platformOverride.features[key], null, 2), JSON.stringify(defaultConfig.reference.features[key], null, 2));
265-
platformConfig.features[key] = immutableJSONPatch(feature, feature.patchFeature);
266-
console.log('Patching feature', platformConfig.features[key]);
265+
feature = immutableJSONPatch(feature, feature.patchFeature);
266+
delete feature.patchFeature;
267+
delete feature.reference;
268+
platformConfig.features[key] = feature;
269+
//console.log('Patching feature', platformConfig.features[key]);
267270
}
268-
delete feature.patchFeature;
269-
delete feature.reference;
270271
}
271272

272273
// Remove appTP feature from platforms that don't use it since it's a large feature

0 commit comments

Comments
 (0)