Not a flag, as far as I’m aware of. It might be feasible, though (I can’t test that right now) to check this via fileSystemProvider.getPluginFolder(). For example, it might be as easy as checking whether this includes 'develop' (again: not tested, but it came to my mind while thinking about it)…
Hmmm. Normally I’d do this through an environment variable during my build process. This can then be injected at build time into my project so that when I build for release, the value is set one way, and when I build for debug, it’s another.
Another option is to look for the presence of a file that you only provide for production or debug, and switch based on that. Might be better than looking for the folder name itself (I’m not 100% sure if it is localized or not…, and it could be tricked anyway).
This is usually done as part of your build step. For example, we have yarn build and yarn watch inside Adobe, and one will set a flag as development and the other will set one for production. Depending on this, the build step generates the expected data.
For you, you could set something simple up (if you’re not using a webpack or the like) that drops a file into dist when you’re building a debug build vs when you’re building a release build.
I have my plugin installed through the plugin manager store and then when I work on it I Load it in with UXP DT locally. I can put a file in the plugin directory and check for its existence and that fixes part of my issue. Unfortunately, I can’t check the date on that.
Hmm… where is this from and this will be different than in my release build on the store? IIRC I remember seeing something like this in window.location (I’ll check).