zanaptak / TypedCssClasses

A CSS class type provider for F# web development. Bring external stylesheet classes into your F# code as design-time discoverable compiler-verified properties.
MIT License
166 stars 8 forks source link

Setting environment variables for a command #13

Closed NickDarvey closed 2 years ago

NickDarvey commented 2 years ago

I understand I can use environment variables in command parameters, but is there a way to specify environment variables?

My use case is setting TS_NODE_PROJECT to point ts-node to a tsconfig.json.

zanaptak commented 2 years ago

No, not directly in the type provider. I would recommend using a script (node, bash, powershell, etc.) to set up the environment and call your command. For example see the FableTailwind sample, where we could have hypothetically called the Tailwind CLI directly, but instead we are calling a tailwind-process.js script and passing in a config filename. You could do something similar and set environment variables as needed from the script arguments.

NickDarvey commented 2 years ago

Makes sense, thanks @zanaptak