From e9c5b65aa79fcfc4b6b2d8e24ee5228bb6d9bba0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Wieczorek Date: Fri, 28 Jan 2022 11:33:44 +0100 Subject: [PATCH] Update esbuild.config and manifest --- esbuild.config.js | 19 ++++++++++--------- manifest.json | 15 +++++++-------- package.json | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/esbuild.config.js b/esbuild.config.js index d99ff61..faaaeab 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -2,6 +2,13 @@ import esbuild from 'esbuild'; import scss from 'esbuild-plugin-sass'; import svg from 'esbuild-plugin-svgr'; +const watch = process.argv.includes('--watch') && { + onRebuild(error) { + if (error) console.error('[watch] build failed', error); + else console.log('[watch] build finished'); + }, +}; + esbuild .build({ entryPoints: [ @@ -11,17 +18,11 @@ esbuild 'background.ts', ], bundle: true, + minify: true, outdir: './lib', loader: { '.woff': 'file', '.woff2': 'file' }, plugins: [scss(), svg()], - watch: { - onRebuild(error, result) { - try { - console.log('watch build succeeded:', result); - } catch (error) { - console.error('watch build failed:', error); - } - }, - }, + watch, }) + .then(() => console.log('Add-on was built')) .catch(() => process.exit(1)); diff --git a/manifest.json b/manifest.json index 2b2ad73..30199f4 100644 --- a/manifest.json +++ b/manifest.json @@ -1,22 +1,21 @@ { + "description": "Wtyczka pokazująca, jakie dane zostały ~~wykradzione~~ wysłane do podmiotów trzecich przez odwiedzane strony.", "manifest_version": 2, "name": "Problematyczne requesty", "version": "1.0", - - "description": "", - + "homepage_url": "https://git.internet-czas-dzialac.pl/icd/problematic-requests", + "background": { + "scripts": ["lib/background.js"] + }, "sidebar_action": { - "default_title": "Problematic requests", + "default_title": "Problematyczne requesty", "default_panel": "sidebar/sidebar.html", "default_icon": "icons/logo-black-square.svg", "browser_style": true, "open_at_install": true }, - "background": { - "scripts": ["lib/background.js"] - }, "icons": { - "48": "icons/border-48.png" + "48": "icons/logo-black-square.svg" }, "permissions": [ "proxy", diff --git a/package.json b/package.json index c9f45e2..3606f02 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "type": "module", "scripts": { "build": "node esbuild.config.js", - "watch": "npm run build -- --watch", + "watch": "node esbuild.config.js --watch", "typecheck": "tsc --noEmit" }, "repository": {