mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
add build chiunking
This commit is contained in:
1 parent
ff3ed9d656
commit
47c87970cd
32 files changed
+16
No files matched your search
@@ -0,0 +1,6 @@
|
||||
import { assertSecret } from "@blitzkit/core";
|
||||
|
||||
export function isChunkEnabled(chunk: string) {
|
||||
const buildChunk = assertSecret(import.meta.env.BUILD_CHUNK);
|
||||
return [chunk, "*"].includes(buildChunk);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
import locales from "@blitzkit/i18n/locales.json";
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { isChunkEnabled } from "../../astro/isChunkEnabled";
|
||||
import ClientUnmountedWarning from "../../components/ClientUnmountedWarning.astro";
|
||||
import ColorScale from "../../components/ColorScale.astro";
|
||||
import HomeCosmetics from "../../components/HomeCosmetics.astro";
|
||||
@@ -14,6 +15,8 @@ import { clientUnmounted } from "../../game/unmounted";
|
||||
import BaseLayout from "../../layouts/BaseLayout.astro";
|
||||
|
||||
export const getStaticPaths = (() => {
|
||||
if (!isChunkEnabled("pages")) return [];
|
||||
|
||||
return [
|
||||
...locales.supported
|
||||
.filter(({ locale }) => locale !== locales.default)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { GetStaticPaths } from "astro";
|
||||
import { isChunkEnabled } from "../../astro/isChunkEnabled";
|
||||
|
||||
export const getStaticPaths = (() => {
|
||||
if (!isChunkEnabled("api")) return [];
|
||||
return [{ params: { api: "api" } }];
|
||||
}) satisfies GetStaticPaths;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user