mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
externalize game
This commit is contained in:
1 parent
152e0a6680
commit
333866a9d6
4 files changed
+15
-16
No files matched your search
@@ -9,5 +9,10 @@
|
|||||||
"webp",
|
"webp",
|
||||||
"hocs",
|
"hocs",
|
||||||
"cooldown"
|
"cooldown"
|
||||||
|
],
|
||||||
|
"userWords": [
|
||||||
|
"WOTB",
|
||||||
|
"USMAP",
|
||||||
|
"favicons"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,12 @@ export default defineConfig({
|
|||||||
minifySyntax: false,
|
minifySyntax: false,
|
||||||
minifyWhitespace: true,
|
minifyWhitespace: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
external: ["@blitzkit/game"],
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
output: "static",
|
output: "static",
|
||||||
site: "https://blitzkit.app",
|
site: "https://blitzkit.app",
|
||||||
@@ -25,18 +31,5 @@ export default defineConfig({
|
|||||||
build: { concurrency: 4 },
|
build: { concurrency: 4 },
|
||||||
adapter: undefined,
|
adapter: undefined,
|
||||||
|
|
||||||
integrations: [
|
integrations: [favicons(), react()],
|
||||||
favicons({
|
|
||||||
name: strings.common.name,
|
|
||||||
short_name: strings.common.name,
|
|
||||||
|
|
||||||
background: mauveDark.mauve1,
|
|
||||||
themes: [mauve.mauve1, mauveDark.mauve1],
|
|
||||||
appleStatusBarStyle: "black-translucent",
|
|
||||||
|
|
||||||
version: packageJSON.version,
|
|
||||||
}),
|
|
||||||
|
|
||||||
react(),
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
@@ -4,8 +4,9 @@ import { clientUnmounted } from "./unmounted";
|
|||||||
|
|
||||||
let _game: GameInterface | null = null;
|
let _game: GameInterface | null = null;
|
||||||
|
|
||||||
if (!clientUnmounted) {
|
if (!clientUnmounted && import.meta.env.SSR) {
|
||||||
const { GameInterface } = await import("@blitzkit/game");
|
const { GameInterface } = await import("@blitzkit/game");
|
||||||
|
|
||||||
_game = new GameInterface(
|
_game = new GameInterface(
|
||||||
assertSecret(import.meta.env.PUBLIC_WOTB_CLIENT),
|
assertSecret(import.meta.env.PUBLIC_WOTB_CLIENT),
|
||||||
assertSecret(import.meta.env.WOTB_USMAP),
|
assertSecret(import.meta.env.WOTB_USMAP),
|
||||||
|
|||||||
@@ -37,5 +37,5 @@ export async function GET({
|
|||||||
const tag = assertDiscoveryTag(assetDiscovery);
|
const tag = assertDiscoveryTag(assetDiscovery);
|
||||||
const part = game!.tankPart(tag, params.part);
|
const part = game!.tankPart(tag, params.part);
|
||||||
|
|
||||||
return Response.json(parts.length);
|
return Response.json(part.length);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user