Skip to content

Commit

Permalink
Add 'overrides' key for browser-specific manifest settings (#1055)
Browse files Browse the repository at this point in the history
* Add 'overrides' key for browser-specific manifest settings (shallow-merge)

* Remove unnecessary check.
  • Loading branch information
tbrockman authored Aug 26, 2024
1 parent 05a3a77 commit 95af8a2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli/plasmo/src/features/manifest-factory/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export abstract class PlasmoManifest<T extends ExtensionManifest = any> {
return {}
}

const output = await this.prepareOverrideManifest()
let output = await this.prepareOverrideManifest()

if ((output.web_accessible_resources?.length || 0) > 0) {
output.web_accessible_resources = await this.resolveWAR(
Expand Down Expand Up @@ -624,6 +624,10 @@ export abstract class PlasmoManifest<T extends ExtensionManifest = any> {
}
}

if (output.overrides && output.overrides[this.browser]) {
output = { ...output, ...output.overrides[this.browser] }
delete output.overrides
}
return this.injectEnvToObj(output)
}

Expand Down

0 comments on commit 95af8a2

Please sign in to comment.