Add a $version global.
This commit is contained in:
parent
2fa59f14d6
commit
44d33d41ae
|
@ -35,9 +35,10 @@ const sourceDir = toAbsolutePath("../source");
|
||||||
await fsp.mkdir(outDir, {recursive: true});
|
await fsp.mkdir(outDir, {recursive: true});
|
||||||
|
|
||||||
// Write the WebExtension manifest file.
|
// Write the WebExtension manifest file.
|
||||||
|
const manifest = createManifest(browser);
|
||||||
await fsp.writeFile(
|
await fsp.writeFile(
|
||||||
path.join(outDir, "manifest.json"),
|
path.join(outDir, "manifest.json"),
|
||||||
JSON.stringify(createManifest(browser)),
|
JSON.stringify(manifest),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Write the web-ext configuration file.
|
// Write the web-ext configuration file.
|
||||||
|
@ -73,6 +74,7 @@ const options: esbuild.BuildOptions = {
|
||||||
$browser: JSON.stringify(browser),
|
$browser: JSON.stringify(browser),
|
||||||
$dev: JSON.stringify(dev),
|
$dev: JSON.stringify(dev),
|
||||||
$test: JSON.stringify(test),
|
$test: JSON.stringify(test),
|
||||||
|
$version: JSON.stringify(manifest.version),
|
||||||
},
|
},
|
||||||
entryPoints: [
|
entryPoints: [
|
||||||
path.join(sourceDir, "background/setup.ts"),
|
path.join(sourceDir, "background/setup.ts"),
|
||||||
|
|
|
@ -12,4 +12,5 @@ declare global {
|
||||||
const $browser: "chromium" | "firefox";
|
const $browser: "chromium" | "firefox";
|
||||||
const $dev: boolean;
|
const $dev: boolean;
|
||||||
const $test: boolean;
|
const $test: boolean;
|
||||||
|
const $version: string;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue