Skip to content

Commit

Permalink
prioritize fastboot differently in package.json merge
Browse files Browse the repository at this point in the history
Now that the fastboot-specific package.json output includes `type: 'addon'` within the ember metadata, it needs to come after the app's own ember metadata. Otherwise the app gets labeled as an addon.
  • Loading branch information
ef4 committed Sep 24, 2021
1 parent a8eb6ae commit 7be3a2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,11 +910,14 @@ export class AppBuilder<TreeNames> {
}

private combinePackageJSON(meta: AppMeta): object {
let pkgLayers = [this.app.packageJSON, { keywords: ['ember-addon'], 'ember-addon': meta }];
let pkgLayers: any[] = [this.app.packageJSON];
let fastbootConfig = this.fastbootConfig;
if (fastbootConfig) {
// fastboot-specific package.json output is allowed to add to our original package.json
pkgLayers.push(fastbootConfig.packageJSON);
}
// but our own new v2 app metadata takes precedence over both
pkgLayers.push({ keywords: ['ember-addon'], 'ember-addon': meta });
return combinePackageJSON(...pkgLayers);
}

Expand Down

0 comments on commit 7be3a2b

Please sign in to comment.