chore: change build outfile to addonRef.js

This commit is contained in:
Northword 2023-07-17 17:17:27 +08:00
parent 229411ae61
commit 9fd98494f7
2 changed files with 6 additions and 3 deletions

4
addon/bootstrap.js vendored
View File

@ -91,7 +91,7 @@ async function startup({ id, version, resourceURI, rootURI }, reason) {
ctx._globalThis = ctx; ctx._globalThis = ctx;
Services.scriptloader.loadSubScript( Services.scriptloader.loadSubScript(
`${rootURI}/chrome/content/scripts/index.js`, `${rootURI}/chrome/content/scripts/__addonRef__.js`,
ctx, ctx,
); );
} }
@ -111,7 +111,7 @@ function shutdown({ id, version, resourceURI, rootURI }, reason) {
.getService(Components.interfaces.nsIStringBundleService) .getService(Components.interfaces.nsIStringBundleService)
.flushBundles(); .flushBundles();
Cu.unload(`${rootURI}/chrome/content/scripts/index.js`); Cu.unload(`${rootURI}/chrome/content/scripts/__addonRef__.js`);
if (chromeHandle) { if (chromeHandle) {
chromeHandle.destruct(); chromeHandle.destruct();

View File

@ -211,7 +211,10 @@ async function esbuild() {
}, },
bundle: true, bundle: true,
target: "firefox102", 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 // Don't turn minify on
// minify: true, // minify: true,
}).catch(() => exit(1)); }).catch(() => exit(1));