From 86b3b7ef5ee6863a3e976e8352e6d03f25494e6a Mon Sep 17 00:00:00 2001 From: Thomas Rupprecht Date: Thu, 5 Jan 2023 16:40:11 +0100 Subject: [PATCH] add web-ext-config.js and add watch scripts --- package.json | 11 +++++++---- web-ext-config.js | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 web-ext-config.js diff --git a/package.json b/package.json index 0e088d2..6516b99 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/web-ext-config.js b/web-ext-config.js new file mode 100644 index 0000000..8610922 --- /dev/null +++ b/web-ext-config.js @@ -0,0 +1,7 @@ +module.exports = { + sourceDir: 'src/', + build: { + overwriteDest: true, + filename: '_usr_space-{version}.zip', + }, +};