forked from mubaidr/vite-vue3-browser-extension-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.config.ts
47 lines (45 loc) · 1.23 KB
/
manifest.config.ts
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
import { env } from 'node:process'
import type { ManifestV3Export } from '@crxjs/vite-plugin'
import packageJson from './package.json'
const { version, name, description, displayName } = packageJson
const [major, minor, patch, label = '0'] = version
.replace(/[^\d.-]+/g, '')
.split(/[.-]/)
export default {
name: env.mode === 'staging' ? `[INTERNAL] ${name}` : displayName || name,
description,
version: `${major}.${minor}.${patch}.${label}`,
version_name: version,
manifest_version: 3,
action: {
default_popup: 'src/popup/index.html',
},
background: {
service_worker: 'src/background/index.ts',
type: 'module',
},
content_scripts: [
{
all_frames: true,
js: ['src/content-script/index.ts'],
matches: ['<all_urls>'],
run_at: 'document_end',
},
],
options_page: 'src/options/index.html',
offline_enabled: true,
permissions: ['storage', 'activeTab', 'tabs'],
host_permissions: ['<all_urls>'],
web_accessible_resources: [
{
matches: ['<all_urls>'],
resources: ['src/content-script/index.ts'],
},
],
icons: {
16: 'src/assets/logo.png',
24: 'src/assets/logo.png',
32: 'src/assets/logo.png',
128: 'src/assets/logo.png',
},
} as ManifestV3Export