From 9fd98494f79c912844c14df488073d71305ee7e2 Mon Sep 17 00:00:00 2001 From: Northword Date: Mon, 17 Jul 2023 17:17:27 +0800 Subject: [PATCH] chore: change build outfile to addonRef.js --- addon/bootstrap.js | 4 ++-- scripts/build.mjs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/addon/bootstrap.js b/addon/bootstrap.js index 05bc161..887e3ab 100644 --- a/addon/bootstrap.js +++ b/addon/bootstrap.js @@ -91,7 +91,7 @@ async function startup({ id, version, resourceURI, rootURI }, reason) { ctx._globalThis = ctx; Services.scriptloader.loadSubScript( - `${rootURI}/chrome/content/scripts/index.js`, + `${rootURI}/chrome/content/scripts/__addonRef__.js`, ctx, ); } @@ -111,7 +111,7 @@ function shutdown({ id, version, resourceURI, rootURI }, reason) { .getService(Components.interfaces.nsIStringBundleService) .flushBundles(); - Cu.unload(`${rootURI}/chrome/content/scripts/index.js`); + Cu.unload(`${rootURI}/chrome/content/scripts/__addonRef__.js`); if (chromeHandle) { chromeHandle.destruct(); diff --git a/scripts/build.mjs b/scripts/build.mjs index f6c4a93..2ef6a96 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -211,7 +211,10 @@ async function esbuild() { }, bundle: true, target: "firefox102", - outfile: path.join(buildDir, "addon/chrome/content/scripts/index.js"), + outfile: path.join( + buildDir, + `addon/chrome/content/scripts/${config.addonRef}.js`, + ), // Don't turn minify on // minify: true, }).catch(() => exit(1));