Code Monkey home page Code Monkey logo

Comments (4)

vhscom avatar vhscom commented on May 24, 2024

This is great, Tim. Recent versions of SvelteKit have reworked the environment system. $env/static/public and friends are a thing now and worth calling out in a reboot of this post.

from timdeschryver.dev.

vhscom avatar vhscom commented on May 24, 2024

Here's a reboot by Scott Spence https://scottspence.com/posts/sveltekit-environment-variables-with-the-sveltekit-env-module

from timdeschryver.dev.

timdeschryver avatar timdeschryver commented on May 24, 2024

Oh sweet - thanks for the heads up!
I did not know about that one @vhscom.

Since it got its place on the official docs, I'll just probably point to that one at the start of the article.
If you want, feel free to create a PR with those changes.

from timdeschryver.dev.

ryvdx avatar ryvdx commented on May 24, 2024

Maybe I'm missing something, but it doesn't feel the svelte solution made the problem obsolete. I'm seeing many others have the same problem as I am having: you create a .env file and add environment variables to it. Regardless if you use static or dynamic environment variables, it seems they are still incorporated into the build process. Which is unfortunate since if you containerize your SvelteKit app, the natural behavior is to pass in the environment variables by the infrastructure. But that does not work. Passing in environment variables in docker or kubernetes are ignored and the values in the .env trump anything. Am I missing something? Seems we still need dotenv for containerized SvelteKit apps.

from timdeschryver.dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.