sl0wik's avatar

env variables in sass files

Is there any way to access env variables from sass files using mix?

0 likes
5 replies
EmilMoe's avatar

Environment variables are defined either by server configurations or within PHP. Unfortunately that can't be transfered to Node and JavaScript.

You must make a custom script that parses the .env file if you want that, but may I ask in which case you need this?

EmilMoe's avatar

I see. I take my words back, I didn't knew a proxy already existed :-)

But you still need to inject those to your SASS. I'm afraid of trying to say too many truths now ;-) But maybe you can inject parameters to sass from mix?

sl0wik's avatar

Seems like I can do it only with "dirty" tricks like playing with include path, or generating files.

Please or to participate in this conversation.