runtime-env / import-meta-env

Build once, deploy anywhere.
http://import-meta-env.org/
MIT License
193 stars 13 forks source link

Feedback on import-meta-env Usage #1179

Open soc221b opened 8 months ago

soc221b commented 8 months ago

Hello, import-meta-env users! We'd love to hear from you about how you are using our packages and gather feedback on your experiences. Specifically, we're interested in the following points:

Usage of import-meta-env: Please let us know how you are using the import-meta-env feature in your projects. Are there any specific use cases or patterns you've found it particularly useful for?

JavaScript Bundler/Transformer: Share which JavaScript bundler or transformer you are using alongside import-meta-env. Whether it's Webpack, Rollup, Babel, or something else, please let us know. This information can help us tailor our documentation and support to better suit your needs.

Missing Features: If there are any features or enhancements that you feel are currently missing in import-meta-env and would be beneficial for your project, please describe them in detail.

Your Feedback:

[Please provide any feedback, details, or examples related to the above points.]

Additional Information:

Node.js Version: [Your Node.js version] import-meta-env Version: [Your package version]

Your feedback is incredibly valuable to us, and it will help us improve import-meta-env to better meet your needs and the broader community. Thank you for taking the time to share your experiences and suggestions!

hugochinchilla commented 6 months ago

On development mode I would like to be able to pass the environment object instead of a file, so I can implement logic of merging whatever dotenv files I like.

HermanBilous commented 5 months ago

Hey! I'm using import-meta-env on my project powered by vite. The installation process was straightforward. I'd say that for me the only missing feature for now is support of vite's way of importing env files. E.g. when I start vite server in dev mode, it will read runtime env, then .env.development.local, .env.development, .env.local and only then .env file. The confusing thing is that VITE_ variables get to be resolved properly, but variables I add using import-meta-env only load from one file. It would be awesome to see them being loaded in the same way.

sebastiaan-dev commented 5 months ago

Hi! Thank you for writing this package, it's great. The only feedback I have is that I struggled quite a lot with setting it up. I am using yarn with PnP so the path node_modules is not available, I tried different things like:

yarn add -D @import-meta-env/cli dotenv
yarn dlx pkg $(yarn bin import-meta-env) -o import-meta-env -t node18-alpine-x64

But this did not work, I ended up doing what the docker compose example also did. Which is setting up a separate layer in the Docker image and then importing the built binary in my the final nginx application. Maybe this approach could be more clearly stated? As it is more agnostic to the repository setup.

shamrt commented 4 months ago

I've been using it in my last two shops, and things have gone well! Both implementations have used the Babel plugin.

One issue we've encountered involves having to fix single-quotes in dotenv key-values, for which I've composed a fix and submitted a PR: #1235. (Any chance you could provide feedback on it?)