manitej
11/19/2021, 1:54 PMRyan
11/19/2021, 2:07 PMenvironment.ts
. I don't think you can access the node environment, that would need to happen as part of the build process.Gabriel Araújo
11/19/2021, 2:08 PMRyan
11/19/2021, 2:09 PMmanitej
11/19/2021, 2:33 PMmanitej
11/19/2021, 2:33 PMmanitej
11/19/2021, 2:34 PMRyan
11/19/2021, 2:46 PMFrank
manitej
11/20/2021, 5:31 AMRyan
11/20/2021, 5:43 AMmanitej
11/20/2021, 5:43 AMRyan
11/20/2021, 5:55 AMRyan
11/20/2021, 6:02 AMif (environment.name === 'prod') {
// do something
}
In this case it may completely remove the block, because at compile time environment.name = "{{ ENVIRONMENT_NAME }}"
and it thinks it's a constant and tree shakes it.
Just something to watch out for 🙂. You have to get a bit clever with it.