Skip to content

Commit 5e5f8b1

Browse files
committed
Add flag EP_FAST_BUILD
1 parent 62bc74f commit 5e5f8b1

File tree

5 files changed

+30
-77
lines changed

5 files changed

+30
-77
lines changed

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
EP_SESSIONS_API="https://static.europython.eu/programme/ep2025/releases/current/sessions.json"
22
EP_SPEAKERS_API="https://static.europython.eu/programme/ep2025/releases/current/speakers.json"
33
EP_SCHEDULE_API="https://static.europython.eu/programme/ep2025/releases/current/schedule.json"
4+
EP_FAST_BUILD="true"

astro.config.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from "path";
2+
import { loadEnv } from "vite";
23
import { defineConfig } from "astro/config";
34
import mdx from "@astrojs/mdx";
45
import sitemap from "@astrojs/sitemap";
@@ -27,7 +28,14 @@ if (!gitVersion) {
2728
}
2829
}
2930

30-
const fastBuild = false;
31+
const mode =
32+
process.argv.find((arg) =>
33+
["development", "production", "preview"].includes(arg)
34+
) || "production";
35+
const fastBuild = loadEnv(mode, process.cwd(), "").EP_FAST_BUILD === "true";
36+
console.log(
37+
`\x1b[35m[EP]\x1b[0m Fast Build: \x1b[1m\x1b[34m${fastBuild}\x1b[0m`
38+
);
3139

3240
function dontDie() {
3341
return {

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@
5151
"prettier-plugin-astro": "^0.14.1",
5252
"puppeteer": "^24.9.0",
5353
"tsx": "^4.19.4",
54-
"typescript": "^5.8.3"
54+
"typescript": "^5.8.3",
55+
"vite": "^6.3.5"
5556
},
5657
"prettier": {
5758
"proseWrap": "always"

pnpm-lock.yaml

Lines changed: 17 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ interface ImportMetaEnv {
55
readonly EP_SESSIONS_API: string;
66
readonly EP_SPEAKERS_API: string;
77
readonly EP_SCHEDULE_API: string;
8+
readonly EP_FAST_BUILD: boolean;
89
}
910

1011
interface ImportMeta {

0 commit comments

Comments
 (0)