Open stevebeauge opened 3 months ago
Following question https://github.com/PlasmoHQ/plasmo/discussions/919
I need to dynamically define the update_url property of the manifest, depending both on on the tag and the browser.
update_url
I expect the plasmo out of the variables, as described in Built-in Environment Variables to be injected into the following string:
"update_url": "https://somewhere.corp.com/$PLASMO_TAG/ourextension-$PLASMO_BROWSER-mv3-$PLASMO_TAG.update.xml"
Providing tag tag1 and browser chrome to plasmo build command, I expect to get this string in the final manifest:
tag1
chrome
"update_url": "https://somewhere.corp.com/tag1/ourextension-chrome-mv3-tag1.update.xml"
However, the string results in:
Variables from the .env files are ok in my actual project.
As a workaround, I can define myself the variables using a build script:
"build" : "cross-env PLASMO_TAG=tag1 PLASMO_BROWSER=chrome plasmo build --target=chrome-mv3 --tag=tag1
In this case, the resulting string is OK.
FYI, I'm working on W10, using plasmo 0.83 (latest version does not build because of incorrect icon.png handling.
Latest
Windows
Chrome, Microsoft Edge
π‘ 0 | Running command: build π£ Plasmo v0.83.1 π΄ The Browser Extension Framework π WARN | A new version of plasmo is available: v0.85.2 | Run "pnpm i plasmo@0.85.2" to update π΅ INFO | Prepare to bundle the extension... π‘ 1 | Creating Manifest Factory... π‘ 2 | Loaded env from .env.dev π‘ 3 | Ensure exists: c:\path\to\myextension\.plasmo π‘ 4 | c:\path\to\myextension\assets\icon.png found, creating resized icons π‘ 5 | Loaded env from .env.dev π‘ 6 | Creating static templates for popup π‘ 7 | Creating static templates for options π‘ 8 | Creating static templates for newtab π‘ 9 | Creating static templates for devtools π‘ 10 | Creating static templates for sidepanel π‘ 11 | Creating page mount template for tabs π‘ 12 | Parsed config: { matches: [ '<all_urls>' ], world: 'MAIN' } π‘ 13 | Adding content script: c:\path\to\myextension\src\contents\MainWorld.ts π‘ 14 | Adding content script: c:\path\to\myextension\src\contents\TriggerSearchButton.ts π‘ 15 | { messageHandlerList: [], portHandlerList: [] } π‘ 16 | Creating BGSW entry π‘ 17 | Hash changed, updating manifest π΅ INFO | Loaded environment variables from: [ '.env.dev' ] π‘ 0 | @plasmohq/parcel-transformer-manifest π‘ 1 | Adding tab modalhost.tsx π‘ 2 | Adding tab modalhost.html π‘ 3 | Adding icons π‘ 4 | Adding default_icon π‘ 5 | Adding default_popup π‘ 6 | Handling background scripts π‘ 7 | Handling background service worker π‘ 0 | @plasmohq/parcel-bundler π‘ 0 | @plasmohq/parcel-packager π‘ 0 | @plasmohq/parcel-optimizer-encapsulate NestedAppAuthController.b32b4372.js NestedAppAuthController.[hash].js π‘ 1 | @plasmohq/parcel-optimizer-encapsulate tabs\modalhost.46cc4181.js tabs\modalhost.[hash].js π‘ 2 | @plasmohq/parcel-optimizer-encapsulate popup.0c24dd77.js popup.[hash].js π‘ 3 | @plasmohq/parcel-optimizer-encapsulate static\background\index.js static\background\index.js π‘ 0 | @plasmohq/parcel-optimizer-encapsulate tabs\modalhost.50eb5ebb.js tabs\modalhost.[hash].js π‘ 0 | @plasmohq/optimizer-es: NestedAppAuthController.b32b4372.js NestedAppAuthController.[hash].js c:\path\to\myextension π‘ 1 | @plasmohq/optimizer-es: tabs\modalhost.46cc4181.js tabs\modalhost.[hash].js c:\path\to\myextension π‘ 2 | @plasmohq/optimizer-es: popup.0c24dd77.js popup.[hash].js c:\path\to\myextension π‘ 3 | @plasmohq/optimizer-es: static\background\index.js static\background\index.js c:\path\to\myextension π‘ 4 | optimizer-es: use SWC for NestedAppAuthController.[hash].js π‘ 5 | optimizer-es: use SWC for tabs\modalhost.[hash].js π‘ 6 | optimizer-es: use SWC for popup.[hash].js π‘ 7 | optimizer-es: use SWC for static\background\index.js π‘ 1 | @plasmohq/parcel-optimizer-encapsulate BPGFTGZB.e29f5f05.js BPGFTGZB.[hash].js π‘ 2 | @plasmohq/parcel-optimizer-encapsulate popup.6f7cb207.js popup.[hash].js π‘ 3 | @plasmohq/parcel-optimizer-encapsulate MainWorld.7fc89055.js MainWorld.[hash].js π‘ 0 | @plasmohq/optimizer-es: tabs\modalhost.50eb5ebb.js tabs\modalhost.[hash].js c:\path\to\myextension π‘ 1 | @plasmohq/optimizer-es: BPGFTGZB.e29f5f05.js BPGFTGZB.[hash].js c:\path\to\myextension π‘ 2 | @plasmohq/optimizer-es: popup.6f7cb207.js popup.[hash].js c:\path\to\myextension π‘ 3 | @plasmohq/optimizer-es: MainWorld.7fc89055.js MainWorld.[hash].js c:\path\to\myextension π‘ 4 | optimizer-es: use SWC for tabs\modalhost.[hash].js π‘ 5 | optimizer-es: use SWC for BPGFTGZB.[hash].js π‘ 6 | optimizer-es: use SWC for popup.[hash].js π‘ 7 | optimizer-es: use SWC for MainWorld.[hash].js π‘ 4 | @plasmohq/parcel-optimizer-encapsulate TriggerSearchButton.be12c79d.js TriggerSearchButton.[hash].js π‘ 8 | @plasmohq/optimizer-es: TriggerSearchButton.be12c79d.js TriggerSearchButton.[hash].js c:\path\to\myextension π‘ 9 | optimizer-es: use SWC for TriggerSearchButton.[hash].js π’ DONE | Finished in 29635ms! π΅ INFO | Zip Package size: 5.75 MB in 2381ms
What happened?
Following question https://github.com/PlasmoHQ/plasmo/discussions/919
I need to dynamically define the
update_url
property of the manifest, depending both on on the tag and the browser.I expect the plasmo out of the variables, as described in Built-in Environment Variables to be injected into the following string:
Providing tag
tag1
and browserchrome
to plasmo build command, I expect to get this string in the final manifest:However, the string results in:
Variables from the .env files are ok in my actual project.
As a workaround, I can define myself the variables using a build script:
In this case, the resulting string is OK.
FYI, I'm working on W10, using plasmo 0.83 (latest version does not build because of incorrect icon.png handling.
Version
Latest
What OS are you seeing the problem on?
Windows
What browsers are you seeing the problem on?
Chrome, Microsoft Edge
Relevant log output
(OPTIONAL) Contribution
Code of Conduct