From 8e739f1be2929d20d842a535c5df1ecd020360f3 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sat, 4 Apr 2026 12:23:16 +0700 Subject: [PATCH] fix: set basePath for GitHub Pages deployment Assets and routes now correctly resolve under /loldle subdirectory. --- lib/champion-data.js | 2 +- next.config.mjs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/champion-data.js b/lib/champion-data.js index 5ed4c32..11bb9b4 100644 --- a/lib/champion-data.js +++ b/lib/champion-data.js @@ -9,7 +9,7 @@ export async function loadChampions() { if (loadPromise) return loadPromise; loadPromise = (async () => { - const response = await fetch("/champions.json"); + const response = await fetch(`/loldle/champions.json`); if (!response.ok) { loadPromise = null; throw new Error(`Failed to load champions: ${response.status}`); diff --git a/next.config.mjs b/next.config.mjs index 5ebb000..38e3208 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", + basePath: "/loldle", images: { unoptimized: true, },