-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
53 lines (50 loc) · 3.46 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"name": "browser-extension-sample-app",
"version": "0.0.1",
"description": "Description of the extension",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/ba32107/browser-extension-sample.git"
},
"author": "Balazs Gyurak",
"license": "MIT",
"bugs": {
"url": "https://github.com/ba32107/browser-extension-sample/issues/new"
},
"homepage": "https://github.com/ba32107/browser-extension-sample",
"scripts": {
"clean": "rm -rf ./dist && rm -rf ./tsc-out && rm -rf ./web-ext-artifacts",
"prep-dist": "npm run clean && mkdir -p ./dist",
"copy-assets": "cp ./src/html/* ./dist && cp ./src/images/* ./dist",
"get-git-commit-hash": "git rev-parse HEAD",
"get-nbgv-var": "case $(git rev-parse --abbrev-ref HEAD) in \"main\") echo \"SimpleVersion\" ;; *) echo \"Version\" ;; esac",
"get-version": "nbgv get-version --variable $(npm run --silent get-nbgv-var)",
"prep-manifest": "extension_version=\"$(npm run --silent get-version)\"; jq --arg version \"$extension_version\" '.version=$version' ./src/manifest/base.json",
"copy-manifest": "npm run --silent prep-manifest | cat - ./src/manifest/chrome.json | jq -s '.[0] * .[1]' > ./dist/manifest.json",
"copy-manifest-ff": "npm run --silent prep-manifest | cat - ./src/manifest/firefox.json | jq -s '.[0] * .[1]' > ./dist/manifest.json",
"lint": "eslint ./src",
"compile": "npx tsc",
"start": "npm run prep-dist && npm run copy-assets && npm run copy-manifest && esbuild --watch --bundle --sourcemap --outdir=dist --define:__PRODUCTION__=false --define:__GIT_COMMIT_HASH__=\\\"$(npm run --silent get-git-commit-hash)\\\" ./src/js/background.ts ./src/js/contentScript.ts ./src/js/popup.ts",
"start-ff": "npm run prep-dist && npm run copy-assets && npm run copy-manifest-ff && esbuild --bundle --sourcemap --outdir=dist --define:__PRODUCTION__=false --define:__GIT_COMMIT_HASH__=\\\"$(npm run --silent get-git-commit-hash)\\\" ./src/js/background.ts ./src/js/contentScript.ts ./src/js/popup.ts && web-ext run --source-dir=dist",
"build": "npm run prep-dist && npm run copy-assets && npm run copy-manifest && npm run lint && npm run compile && esbuild --bundle --minify --outdir=dist --define:__PRODUCTION__=true --define:__GIT_COMMIT_HASH__=\\\"$(npm run --silent get-git-commit-hash)\\\" ./src/js/background.ts ./src/js/contentScript.ts ./src/js/popup.ts",
"build-ff": "npm run prep-dist && npm run copy-assets && npm run copy-manifest-ff && npm run lint && npm run compile && esbuild --bundle --minify --outdir=dist --define:__PRODUCTION__=true --define:__GIT_COMMIT_HASH__=\\\"$(npm run --silent get-git-commit-hash)\\\" ./src/js/background.ts ./src/js/contentScript.ts ./src/js/popup.ts && web-ext build --source-dir=dist",
"dist": "npm run build && cd dist && zip -r extension.zip *",
"dist-ff": "npm run build-ff"
},
"devDependencies": {
"@types/chrome": "^0.0.176",
"@types/webextension-polyfill": "^0.8.2",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"esbuild": "^0.14.13",
"eslint": "^8.7.0",
"eslint-plugin-no-unsanitized": "^4.0.1",
"loglevel": "^1.8.0",
"nerdbank-gitversioning": "^3.4.255",
"node-jq": "^2.1.0",
"typescript": "^4.5.5",
"web-ext": "^6.6.0",
"webextension-polyfill": "^0.8.0"
}
}