Skip to content

Commit

Permalink
feat: add package script
Browse files Browse the repository at this point in the history
  • Loading branch information
Robot-Inventor committed Apr 10, 2024
1 parent 52dea35 commit f3d3860
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"main": "index.js",
"scripts": {
"build": "webpack",
"watch": "webpack --watch"
"watch": "webpack --watch",
"package": "ts-node ./script/package.ts",
"version": "npm run build && git add ."
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -33,4 +35,4 @@
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
}
}
}
13 changes: 13 additions & 0 deletions script/package.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { execSync } from "child_process";

console.log("Building...");
execSync("npm run build");

console.log("Packaging for Chrome...");
process.chdir("dist/chrome");
execSync(`npx web-ext build --artifacts-dir "../../web-ext-artifacts/manifestV2"`);

console.log("Packaging for Firefox...");
process.chdir("../firefox");
execSync(`npx web-ext build --artifacts-dir "../../web-ext-artifacts/manifestV3"`);
console.log("Done.");

0 comments on commit f3d3860

Please sign in to comment.