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:
+3
-1
@@ -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 });
|
||||
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user