Files
blitzkit/packages/website-ue/astro.config.ts
T

104 lines
3.0 KiB
TypeScript
Raw Normal View History

2025-11-28 13:00:41 -06:00
import node from "@astrojs/node";
import react from "@astrojs/react";
import locales from "@blitzkit/i18n/locales.json";
import strings from "@blitzkit/i18n/strings/en.json";
import { mauve, mauveDark } from "@radix-ui/colors";
import favicons from "astro-favicons";
import { defineConfig } from "astro/config";
import packageJSON from "../../package.json";
const POSSIBLE_TARGETS = ["app", "web"];
2025-11-28 13:03:33 -06:00
const target = process.env.PUBLIC_TARGET;
2025-11-28 13:00:41 -06:00
if (!target || !POSSIBLE_TARGETS.includes(target)) {
throw new Error("Invalid target");
}
export default defineConfig({
devToolbar: { enabled: false },
2025-12-19 16:01:58 -06:00
vite: {
server: { allowedHosts: [] },
2025-12-19 22:23:03 -06:00
2025-12-19 16:01:58 -06:00
esbuild: {
2025-12-19 16:07:34 -06:00
minifyIdentifiers: true,
2025-12-19 16:14:36 -06:00
minifySyntax: false,
2025-12-19 16:09:27 -06:00
minifyWhitespace: true,
2025-12-19 16:01:58 -06:00
},
},
2025-11-28 13:00:41 -06:00
output: target === "web" ? "static" : "server",
site: "https://blitzkit.app",
outDir: "../../dist/website",
prefetch: { defaultStrategy: "hover", prefetchAll: true },
2026-01-11 11:52:28 -06:00
build: { concurrency: 4 },
2025-11-28 13:00:41 -06:00
adapter: target === "app" ? node({ mode: "standalone" }) : undefined,
integrations: [
favicons({
name: strings.common.name,
short_name: strings.common.name,
background: mauveDark.mauve1,
themes: [mauve.mauve1, mauveDark.mauve1],
appleStatusBarStyle: "black-translucent",
version: packageJSON.version,
2026-01-07 20:36:55 -06:00
// shortcuts: Object.values(tools)
// .filter((tool) => !tool.disabled && !tool.href)
// .map((tool) => {
// const stringId = (tool.strings ??
// tool.id) as keyof typeof strings.website.tools;
2025-11-28 13:00:41 -06:00
2026-01-07 20:36:55 -06:00
// return {
// name: strings.website.tools[stringId].name,
// name_localized: wrapper(
// (strings) => strings.website.tools[stringId].name
// ),
// description: strings.website.tools[stringId].description,
// description_localized: wrapper(
// (strings) => strings.website.tools[stringId].description
// ),
// short_name: strings.website.tools[stringId].name,
// short_name_localized: wrapper(
// (strings) => strings.website.tools[stringId].name
// ),
// url: `/${tool.id}`,
// icon: `public/assets/tools/${tool.id}.webp`,
// };
// }),
2025-11-28 13:00:41 -06:00
manifest: {
2026-01-07 20:36:55 -06:00
// description: strings.website.home.seo_description,
// description_localized: wrapper(
// (strings) => strings.website.home.seo_description
// ),
2025-11-28 13:00:41 -06:00
dir: "ltr",
categories: ["utilities", "games", "developer", "developer tools"],
id: "com.tresabhi.blitzkit",
start_url: "/",
launch_handler: { client_mode: "navigate-new" },
display: "fullscreen",
display_override: ["fullscreen", "standalone", "minimal-ui"],
lang: locales.default,
orientation: "any",
},
icons: {
windows: true,
android: true,
appleIcon: true,
appleStartup: true,
favicons: true,
yandex: true,
},
}),
react(),
],
});