PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.31k stars 358 forks source link

[RFC] Can I show something in dev mode and hide in prod mode #1001

Closed Eve-Sama closed 2 months ago

Eve-Sama commented 3 months ago

How do you envision this feature/change to look/work like?

I wanna clear all storage data for debug. So I wanna add something UI to do this. I hope it is hide under prod. Display under develop mode. Can I get environment in plasmo?

What is the purpose of this change/feature? Why?

I wanna clear all storage data for debug. So I wanna add something UI to do this. I hope it is hide under prod. Display under develop mode. Can I get environment in plasmo?

(OPTIONAL) Example implementations

No response

(OPTIONAL) Contribution

Verify canary release

Code of Conduct

muzammil0011 commented 2 months ago

You can use Environment Variables, that can help you achieve this functionality.

like:

if(process.env.NODE_ENV === "development"){
    /* The code that you want to execute in development mode only */
    console.log('You are a Developer')
}

Read more about Environment Variables Here