Hello! :wave::skin-tone-2: I’m wondering if it’s p...
# compose-web
s
Hello! 👋🏻 I’m wondering if it’s possible to detect if the compose web project is running in development or distribution mode? I’d like to change some settings based on local development or prod Thanks!
b
This is not compose specific. Webpack injects NODE_ENV=development variable into the bundle. Search round that for specifics.
s
Thanks for the info
s
I think you can also use
window.location.host
and check if it's localhost
s
Indeed, not a bad idea! I did went the
NODE_ENV
way and checked this way:
Copy code
js("process.env.NODE_ENV === 'development'") as Boolean
And wrap this around a
isDevelopment
property.