I have this in my svelte.config.js file but it appears to be ignored in production (it works fine with npm run dev)
import dotenv from 'dotenv-flow';
import adapter from '@sveltejs/adapter-node';
dotenv.config();
...
adapter: adapter({
out: './build',
precompress: true
}),
vite: {
...
server: {
port: process.env.PORT || 3000
}
}
I do not see dotenv anywhere in the build/ directory which means its ignoring .env.local
There are other environment variables my app needs as well its not just port.
My production app is started with systemd using cd build && node index.js