Runtime Env vars in vite
Hey all, I'm trying to figure out a way to run environment variables at runtime rather than at compile time. I've been looking at https://iendeavor.github.io/import-meta-env/ , but I can't seem to get it to work. Specifically, in
I need this because our build system builds once and then distributes to other servers for various regions. We also have staging/beta/dev servers built the same way.
Anything I'm missing? (This isn't necessarily related to solidjs, but, it's a thing that could be used with solidjs
)
transformMode: "runtime" , trying to use this code in a script called by index.html (in fact, a script tag in index.html) just makes global.import_meta_env to be the placeholder, it doesn't get replaced. I need this because our build system builds once and then distributes to other servers for various regions. We also have staging/beta/dev servers built the same way.
Anything I'm missing? (This isn't necessarily related to solidjs, but, it's a thing that could be used with solidjs
Build once, deploy anywhere. Import-meta-env helps to developing applications following the 12-factor principles.
