-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (52 loc) · 1.61 KB
/
vite.config.ts
File metadata and controls
55 lines (52 loc) · 1.61 KB
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
54
55
import vue from '@vitejs/plugin-vue'
import { readFileSync } from 'node:fs'
import { defineConfig } from 'vite'
import webExtension from 'vite-plugin-web-extension'
const targetBrowser = (process.env.TARGET ?? 'chrome') as 'chrome' | 'firefox'
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8')) as {
name: string
version: string
description: string
}
export default defineConfig({
base: './',
plugins: [
vue(),
webExtension({
browser: targetBrowser,
htmlViteConfig: { base: './' },
watchFilePaths: ['package.json'],
manifest: () => ({
manifest_version: 3,
name: 'HackBar V2',
version: pkg.version,
description:
pkg.description ||
'HackBar for Firefox and Chromium (DevTools). WebExtension alternative to legacy XUL HackBar.',
minimum_chrome_version: '110',
icons: {
48: 'icons/icon.png',
},
devtools_page: 'src/devtools/index.html',
options_ui: {
page: 'src/devtools/panel.html',
open_in_tab: true,
},
'{{chrome}}.background': {
service_worker: 'src/background/serviceWorker.ts',
},
'{{firefox}}.background': {
scripts: ['src/background/serviceWorker.ts'],
},
permissions: ['tabs', 'activeTab', 'storage', 'webRequest', 'declarativeNetRequest'],
host_permissions: ['<all_urls>'],
browser_specific_settings: {
gecko: {
id: 'hackbar@chewbaka',
strict_min_version: '109.0',
},
},
}),
}),
],
})