How to combine multiple env variables in package.json's manifest ? #919
Unanswered
stevebeauge
asked this question in
Q&A
Replies: 1 comment
-
Just found that I can use in my package.json build script :
This way, the env variables are injected properly in the manifest. It seems that plasmo is not providing this variables in the manifest builder. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Because we are hosting internally our extension, we have to provide the
update_url
field of the manifest.We have a matrix of tags (dev or prod) and browsers (msedge or chrome). Please note that by "dev" we mean a beta version, for testing.
Each of the combination will ends in a specific url that must match this form:
We build each variation using
--target=msedge-mv3 --tag=prod
(for example) switchesI have trouble generating this URL in the manifest.
What I tried first:
play with env files:
we previously had
.env.dev
and.env.prod
files which is working to fix some settings like the app id and extension name. I tried to create.env.tag.browser
or.env.browser.tag
(.env.msedge.prod
or.env.prod.msedge
) files which contains aPLASMO_PUBLIC_UPDATE_URL
variable. However, it seems that these env files are ignored.compose the
update_url
using multiple environment variables.I tried to define the update URL like this (PLASMO_PUBLIC_HOSTING_ROOT env is defined in the
.env.tag
files):However, only the first variable is populated. The actual value in the generated manifest is
What can I do?
There's still no plasmo api that we can use to hook the build process to perform custom operation.
Beta Was this translation helpful? Give feedback.
All reactions