Closed oren-shlomi closed 3 months ago
See https://github.com/yuanqing/create-figma-plugin/issues/127#issuecomment-1292150266
Then add something like this to your package.json
scripts:
"build-production": "NODE_ENV=production build-figma-plugin --typecheck --minify"
See #127 (comment)
Then add something like this to your
package.json
scripts:"build-production": "NODE_ENV=production build-figma-plugin --typecheck --minify"
Ok this worked, but how do I then load a different .env file based on the NODE_ENV value?
For example in NODE_ENV=production
I want to load process.env.YOUR_DOMAIN
from .prod.env
and in NODE_ENV=dev
I want to load it from .dev.env
Not sure how to configure it in build-figma-plugin-ui.js
build-figma-plugin.ui.js
@yuanqing the comment doesn't help. when running the figma plugin it will read the env (NODE_ENV) incorrectly
I suspect that there’s something you’ve misconfigured. If you’re able to provide a repo with a simple reproduction of the issue, it’d be helpful for investigating further
Hi, how can I access different env files (ex: .dev.env , .prod.env) based on the environment? I tried to define process.env.NODE_ENV during the build script but in runtime I get an error process is not defined.
Basically I'd like to have build for DEV and build for PROD and based on the access different env files.