Merge pull request #66 from northword:change-build-outfile-to-addonRef

chore: change build outfile to addonRef.js
This commit is contained in:
windingwind 2023-07-19 22:31:21 +08:00 committed by GitHub
commit efd56c94e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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));