Thread
#compose-web
    s

    Sebastien Leclerc Lavallee

    2 weeks ago
    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!
    Big Chungus

    Big Chungus

    2 weeks ago
    This is not compose specific. Webpack injects NODE_ENV=development variable into the bundle. Search round that for specifics.
    s

    Sebastien Leclerc Lavallee

    2 weeks ago
    Thanks for the info
    S.

    S.

    2 weeks ago
    I think you can also use
    window.location.host
    and check if it's localhost
    s

    Sebastien Leclerc Lavallee

    2 weeks ago
    Indeed, not a bad idea! I did went the
    NODE_ENV
    way and checked this way:
    js("process.env.NODE_ENV === 'development'") as Boolean
    And wrap this around a
    isDevelopment
    property.