-
-
Couldn't load subscription status.
- Fork 4
Description
User Story
As a developer, when I'm building for multiple environments (dev, staging, prod) and multiple platform targets, I want to define environment variables for replacement in the manifest, so I can dynamically change the name, icons and other properties based on the build requirements.
Example
When building for staging, we make the following changes to our manifest:
- add
-stagingto our app name - change favicon to a custom staging variant
- change
homepage_urlto the staging site (for integration testing)
And, based on semver commits, we also calculate and set out version number automatically when running builds in our ci. We don't get this from package.json, so we also need to update the manifest version number with the correct calculated version.
Potential implementation
Webpack WebExtension Plugin includes this capability by using a similar syntax to vendor keys:
For example:
In JS
process.env.APP_NAMEIn Manifest
{
"name": "__APP_NAME__",
}