When I run hugo server I see the message in console Environment = 'development'. I am wondering if there is a way to access it using porcess.env.HUGO_ENV for example?
Or is it just to be used inside Hugo engine like if (eq hugo.Environment "development")?
In Windows I use command set HUGO_ENV=development&& hugo server. Then I am able to access it in postcss.config.js via process.env.HUGO_ENV. This works but it is not cross-platform friendly unless I use cross-env library or something like that.
I apologise to both of you @zwbetz. I think I am being incomprehensible with my question.
Use getenv
getenv is a Hugo only command. I was looking to use something similar to getenv in webpack, gulp, postcss processes, while hugo server is running in a project…
Again, I’m sorry.
What I want can already be achieved by manually setting a custom variable in os.
// Windows example
set HUGO_ENV=development&& hugo server