From 80c2aa04013f61dad417a6dcefbb6419cea30c32 Mon Sep 17 00:00:00 2001 From: Zebratic Date: Sat, 11 Jul 2026 02:29:25 +0000 Subject: [PATCH] Fix: bundle output to extension/dist/content/, update manifest path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The esbuild outdir was relative to cwd, so it landed at project root (dist/content/) on a project-root build, not under the extension dir. Fix: - esbuild writes to extension/dist/content/ - manifest.json content_scripts.js → dist/content/index.js - Keeps the extension self-contained so Chrome --load-extension works without any external files --- esbuild.config.mjs | 4 +++- extension/manifest.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/esbuild.config.mjs b/esbuild.config.mjs index c00ba1e..a972852 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -3,7 +3,9 @@ import * as esbuild from 'esbuild'; import { existsSync, mkdirSync } from 'node:fs'; const isWatch = process.argv.includes('--watch'); -const outdir = 'dist/content'; +// Bundle lives under extension/dist/content/ so Chrome can load the +// extension directory without needing any files outside it. +const outdir = 'extension/dist/content'; if (!existsSync(outdir)) mkdirSync(outdir, { recursive: true }); diff --git a/extension/manifest.json b/extension/manifest.json index 72d29b3..4c629d1 100644 --- a/extension/manifest.json +++ b/extension/manifest.json @@ -25,7 +25,7 @@ { "matches": ["*://beat-battle.net/*"], "run_at": "document_idle", - "js": ["content/index.js"], + "js": ["dist/content/index.js"], "css": ["content/inject.css"] } ],