Skip to content

Commit 7264cb2

Browse files
committed
fix image build for prod
1 parent 304acd3 commit 7264cb2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ssg/quickplayData.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { fetchCache } from "./fetchCache";
1010
let quickplayData: any = null;
1111

1212
async function optimizeThumbnailWithRetry(map: string, src: string, maxAttempts: number = 2): Promise<string> {
13-
const publicDir = path.resolve("public/generated/maps");
13+
const baseDir = import.meta.env.PROD ? "dist" : "public";
14+
const publicDir = path.resolve(baseDir, "generated/maps");
1415
await fs.mkdir(publicDir, { recursive: true });
1516

1617
const destFilename = `${map}.webp`;

0 commit comments

Comments
 (0)