solid-start
solid-start copied to clipboard
server env variables require additonal configuration / packages
Currently enviroment variables that are not prefixed with VITE_ will not be loaded,
variables that are prefixed with VITE_ will be exposed to the client (import.meta.env),
what causing it so there is no such thing as server env variable in SolidStart.
this could easily be fixed using dotenv:
import solid from "solid-start/vite";
import dotenv from "dotenv";
import UnoCSS from "unocss/vite";
import { defineConfig } from "vite";
// @ts-expect-error no typing
import vercel from "solid-start-vercel";
export default defineConfig(() => {
dotenv.config();
return {
plugins: [
solid({ ssr: false, adapter: vercel({ edge: false }) }),
UnoCSS(),
],
};
});
but I think that it should not be handled in our end as SolidStart is a meta framework, and should be loading server variables by default.