How to load env on production #12748
Answered
by
brunnerh
karchung0930
asked this question in
Q&A
-
Hihi, I'm using the adapter-node and following the documentation here to deploy: https://kit.svelte.dev/docs/adapter-node I saw that the env will not be loaded automatically on production. I can run this code: I use Actually, after the
|
Beta Was this translation helpful? Give feedback.
Answered by
brunnerh
Aug 6, 2024
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
karchung0930
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.env
files at runtime.If you only used
$env/static/*
, those are built directly into the output code and thus don't need to be loaded but also cannot be changed later.If you don't want to use that, there also is a
--node-args
option, so you can add--node-args="-r dotenv/config"
.