conditionally render siteUrl property in Gatsby-config based on environment

后端 未结 3 2011
青春惊慌失措
青春惊慌失措 2021-01-24 12:30

I would like to set up a simple expression in my gatsby-config.js that determines whether I am working locally or in production so that I can set the siteUrl<

3条回答
  •  后悔当初
    2021-01-24 13:08

    Yes you can, by setting up environment variables.

    Create some .env.* files in root folder for different environments.

    Docs here: https://www.gatsbyjs.org/docs/environment-variables/

提交回复
热议问题