fix(ci): resolve vite import issue in astro.config.mjs for GitHub Actions runner
swadhinbiswas committed 2 months ago
f1c211c
1 parent 0257552
commit f1c211c
2 files changed
+4 -4
Showing 2 changed files+4-4
▼astro.config.mjs
+3-4
| @@ -2,10 +2,9 @@ import node from "@astrojs/node"; | ||
2 | 2 | import react from "@astrojs/react"; |
3 | 3 | import { defineConfig } from "astro/config"; |
4 | 4 | import icon from "astro-icon"; |
5 | -import { loadEnv } from "vite"; | |
6 | 5 | |
7 | -// Load .env before config reads PORT | |
8 | -const env = loadEnv("development", process.cwd(), ""); | |
6 | +// Load environment variables safely | |
7 | +const port = parseInt(process.env.PORT || "4321"); | |
9 | 8 | |
10 | 9 | export default defineConfig({ |
11 | 10 | integrations: [ |
| @@ -17,7 +16,7 @@ export default defineConfig({ | ||
17 | 16 | mode: "standalone", |
18 | 17 | }), |
19 | 18 | server: { |
20 | - port: parseInt(env.PORT || process.env.PORT || "4321"), | |
19 | + port, | |
21 | 20 | host: true, |
22 | 21 | }, |
23 | 22 | vite: { |
24 | 23 | |
▼package.json
+1-0
| @@ -181,6 +181,7 @@ | ||
181 | 181 | "drizzle-kit": "^0.31.8", |
182 | 182 | "pino-pretty": "^13.1.3", |
183 | 183 | "typescript": "^5.9.3", |
184 | + "vite": "^5.4.11", | |
184 | 185 | "vitest": "^4.1.5" |
185 | 186 | }, |
186 | 187 | "engines": { |
187 | 188 | |