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;
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();

View File

@ -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));