🧩 Plasmo Developers�PD
🧩 Plasmo Developers3y ago
3 replies
Avi

Additional permissions for development vs production

Considering that I'm working on an ext that will also have a backend, it makes a lot of sense for Plasmo to automatically set the final host_permissions with the proper hostnames
I.e. during development I will have
{
  "manifest": {
    "host_permissions": ["http://localhost:5000/*"]
  }
}

while in production:

{
  "manifest": {
    "host_permissions": ["https://avi12.com/*"]
  }
}
Solution
Nevermind, I figured that I can just do
{
  "manifest": {
    "host_permissions": ["$PLASMO_PUBLIC_SERVER_URL"]
  }
}

.env.local
PLASMO_PUBLIC_SERVER_URL="http://localhost:5000/*"

.env.production
PUBLIC_PLASMO_SERVER_URL="https://avi12.com/*"
Was this page helpful?