mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
better ssr checking
This commit is contained in:
1 parent
bd140f0eda
commit
6c31f663f6
3 files changed
+3
-65
No files matched your search
@@ -1,20 +1,10 @@
|
|||||||
import node from "@astrojs/node";
|
|
||||||
import react from "@astrojs/react";
|
import react from "@astrojs/react";
|
||||||
import locales from "@blitzkit/i18n/locales.json";
|
|
||||||
import strings from "@blitzkit/i18n/strings/en.json";
|
import strings from "@blitzkit/i18n/strings/en.json";
|
||||||
import { mauve, mauveDark } from "@radix-ui/colors";
|
import { mauve, mauveDark } from "@radix-ui/colors";
|
||||||
import favicons from "astro-favicons";
|
import favicons from "astro-favicons";
|
||||||
import { defineConfig } from "astro/config";
|
import { defineConfig } from "astro/config";
|
||||||
import packageJSON from "../../package.json";
|
import packageJSON from "../../package.json";
|
||||||
|
|
||||||
const POSSIBLE_TARGETS = ["app", "web"];
|
|
||||||
|
|
||||||
const target = process.env.PUBLIC_TARGET;
|
|
||||||
|
|
||||||
if (!target || !POSSIBLE_TARGETS.includes(target)) {
|
|
||||||
throw new Error("Invalid target");
|
|
||||||
}
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
devToolbar: { enabled: false },
|
devToolbar: { enabled: false },
|
||||||
|
|
||||||
@@ -27,13 +17,13 @@ export default defineConfig({
|
|||||||
minifyWhitespace: true,
|
minifyWhitespace: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
output: target === "web" ? "static" : "server",
|
output: "static",
|
||||||
site: "https://blitzkit.app",
|
site: "https://blitzkit.app",
|
||||||
outDir: "../../dist/website",
|
outDir: "../../dist/website",
|
||||||
prefetch: { defaultStrategy: "hover", prefetchAll: true },
|
prefetch: { defaultStrategy: "hover", prefetchAll: true },
|
||||||
|
|
||||||
build: { concurrency: 4 },
|
build: { concurrency: 4 },
|
||||||
adapter: target === "app" ? node({ mode: "standalone" }) : undefined,
|
adapter: undefined,
|
||||||
|
|
||||||
integrations: [
|
integrations: [
|
||||||
favicons({
|
favicons({
|
||||||
@@ -45,58 +35,6 @@ export default defineConfig({
|
|||||||
appleStatusBarStyle: "black-translucent",
|
appleStatusBarStyle: "black-translucent",
|
||||||
|
|
||||||
version: packageJSON.version,
|
version: packageJSON.version,
|
||||||
|
|
||||||
// shortcuts: Object.values(tools)
|
|
||||||
// .filter((tool) => !tool.disabled && !tool.href)
|
|
||||||
// .map((tool) => {
|
|
||||||
// const stringId = (tool.strings ??
|
|
||||||
// tool.id) as keyof typeof strings.website.tools;
|
|
||||||
|
|
||||||
// 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`,
|
|
||||||
// };
|
|
||||||
// }),
|
|
||||||
|
|
||||||
manifest: {
|
|
||||||
// description: strings.website.home.seo_description,
|
|
||||||
// description_localized: wrapper(
|
|
||||||
// (strings) => strings.website.home.seo_description
|
|
||||||
// ),
|
|
||||||
|
|
||||||
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(),
|
react(),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { AbstractAPI } from "./abstract";
|
|||||||
|
|
||||||
let dynamicAPI: AbstractAPI;
|
let dynamicAPI: AbstractAPI;
|
||||||
|
|
||||||
if (typeof window === "undefined") {
|
if (import.meta.env.SSR) {
|
||||||
const { ProxyClient } = await import("@blitzkit/closed");
|
const { ProxyClient } = await import("@blitzkit/closed");
|
||||||
const { ServerAPI } = await import("./server");
|
const { ServerAPI } = await import("./server");
|
||||||
|
|
||||||
|
|||||||
Regular → Executable
File mode changed.
Reference in new issue
Block a user