add web-ext-config.js and add watch scripts

This commit is contained in:
Thomas Rupprecht 2023-01-05 16:40:11 +01:00
parent 39b69904ac
commit 86b3b7ef5e
2 changed files with 14 additions and 4 deletions

View File

@ -11,11 +11,14 @@
"scripts": {
"copy-browser-polyfill": "cp node_modules/webextension-polyfill/dist/browser-polyfill.js src/browser-polyfill.js",
"copy-version": "sed -i 's/^\t\"version\": \".*\",$/\t\"version\": \"'$(rg '^\t\"version\": \"(.+)\",$' -r '$1' < package.json)'\",/' src/manifest.json",
"lint": "web-ext lint -w -s src/",
"prebuild": "cp LICENSE.txt src/",
"build": "web-ext build -o -s src/ -n \"_usr_space-{version}.zip\"",
"postbuild": "rm src/LICENSE.txt",
"lint": "web-ext lint -w",
"test": "echo \"Error: no test specified\" && exit 0",
"watch:firefox": "web-ext run -t firefox-desktop",
"watch:firefox-android": "web-ext run -t firefox-android",
"watch:chromium": "web-ext run -t chromium",
"prebuild": "cp LICENSE.txt src/",
"build": "web-ext build",
"postbuild": "rm src/LICENSE.txt",
"postinstall": "npm run copy-browser-polyfill",
"preversion": "npm run lint && npm test",
"version": "npm run copy-version && git add -u",

7
web-ext-config.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = {
sourceDir: 'src/',
build: {
overwriteDest: true,
filename: '_usr_space-{version}.zip',
},
};