
* feat!: use zotero-plugin-scaffold * fix: tsc error * docs: update readme and comment * fix: clean code, remove useless file * fix: update zotero-plugin-scaffold * fix: set esbuild target to ff115 * chore: clean and update deps * fix: Simplify config files and update dep * fix: update deps * chore: update renovate config * fix: default use proxy mode to install plugin * chore: bump scaffold to 0.0.19 resolve: #113 * fix: bump scaffold to 0.0.20 * fix: use new devtools hack
62 lines
1.7 KiB
TypeScript
62 lines
1.7 KiB
TypeScript
import { defineConfig } from "zotero-plugin-scaffold";
|
|
import pkg from "./package.json";
|
|
import { copyFileSync } from "fs";
|
|
|
|
export default defineConfig({
|
|
source: ["src", "addon"],
|
|
dist: "build",
|
|
name: pkg.config.addonName,
|
|
id: pkg.config.addonID,
|
|
namespace: pkg.config.addonRef,
|
|
updateURL: `https://github.com/{{owner}}/{{repo}}/releases/download/release/${
|
|
pkg.version.includes("-") ? "update-beta.json" : "update.json"
|
|
}`,
|
|
xpiDownloadLink:
|
|
"https://github.com/{{owner}}/{{repo}}/releases/download/v{{version}}/{{xpiName}}.xpi",
|
|
|
|
server: {
|
|
asProxy: true,
|
|
},
|
|
|
|
build: {
|
|
assets: ["addon/**/*.*"],
|
|
define: {
|
|
...pkg.config,
|
|
author: pkg.author,
|
|
description: pkg.description,
|
|
homepage: pkg.homepage,
|
|
buildVersion: pkg.version,
|
|
buildTime: "{{buildTime}}",
|
|
},
|
|
esbuildOptions: [
|
|
{
|
|
entryPoints: ["src/index.ts"],
|
|
define: {
|
|
__env__: `"${process.env.NODE_ENV}"`,
|
|
},
|
|
bundle: true,
|
|
target: "firefox115",
|
|
outfile: `build/addon/chrome/content/scripts/${pkg.config.addonRef}.js`,
|
|
},
|
|
],
|
|
// If you want to checkout update.json into the repository, uncomment the following lines:
|
|
// makeUpdateJson: {
|
|
// hash: false,
|
|
// },
|
|
// hooks: {
|
|
// "build:makeUpdateJSON": (ctx) => {
|
|
// copyFileSync("build/update.json", "update.json");
|
|
// copyFileSync("build/update-beta.json", "update-beta.json");
|
|
// },
|
|
// },
|
|
},
|
|
// release: {
|
|
// bumpp: {
|
|
// execute: "npm run build",
|
|
// },
|
|
// },
|
|
|
|
// If you need to see a more detailed build log, uncomment the following line:
|
|
// logLevel: "trace",
|
|
});
|