Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions extension/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const esbuild = require("esbuild");

const isWatch = process.argv.includes("--watch");

const entryPoints = ["src/background.ts", "src/content.ts", "src/popup.ts"];

const buildOptions = {
bundle: true,
entryPoints,
format: "iife",
minify: !isWatch,
outdir: "dist",
sourcemap: isWatch,
target: "es2020",
};

if (isWatch) {
esbuild.context(buildOptions).then((ctx) => {
ctx.watch();
console.log("Watching for changes...");
});
} else {
esbuild.build(buildOptions).then(() => {
console.log("Build complete");
});
}
5 changes: 3 additions & 2 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
"license": "MIT",
"description": "Browser extension to display GitHub Projects status in issue lists",
"scripts": {
"build": "tsc && mkdir -p dist/styles && cp -r public/* dist/",
"build": "node build.js && mkdir -p dist/styles && cp -r public/* dist/",
"lint": "eslint src/**/*.ts",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watch",
"watch": "tsc --watch"
"watch": "node build.js --watch"
},
"devDependencies": {
"@types/chrome": "0.0.254",
"@types/jest": "29.5.12",
"esbuild": "0.27.0",
"eslint": "9.37.0",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-perfectionist": "4.15.1",
Expand Down
Loading
Loading