Fix: bundle output to extension/dist/content/, update manifest path

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
This commit is contained in:
Zebratic
2026-07-11 02:29:25 +00:00
parent 02a90e839c
commit 80c2aa0401
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -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 });
+1 -1
View File
@@ -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"]
}
],