-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwxt.config.ts
More file actions
121 lines (109 loc) · 3.64 KB
/
Copy pathwxt.config.ts
File metadata and controls
121 lines (109 loc) · 3.64 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import { defineConfig } from 'wxt'
// See https://wxt.dev/api/config.html
// noinspection JSUnusedGlobalSymbols
export default defineConfig({
srcDir: 'src',
modules: ['@wxt-dev/module-vue', '@wxt-dev/i18n/module', '@wxt-dev/auto-icons'],
// https://wxt.dev/guide/essentials/config/auto-imports.html#disabling-auto-imports
// imports: false,
autoIcons: {
enabled: true,
baseIconPath: 'assets/icon.svg',
developmentIndicator: false, // 'overlay' | false
sizes: [96, 24], // Dfault: 128, 48, 32, 16
},
// https://wxt.dev/guide/essentials/config/manifest.html
manifest: ({ browser, mode }) => {
const isFirefox = browser === 'firefox'
const isDev = mode === 'development'
console.log(`isDev: ${isDev} - isFirefox: ${isFirefox}`)
return {
// icons,
default_locale: 'en',
name: '__MSG_name__',
short_name: '__MSG_short_name__',
description: '__MSG_description__',
homepage_url: 'https://cssnr.github.io/cache-cleaner/',
permissions: [
'activeTab',
'browsingData',
'contextMenus',
// 'notifications',
'scripting',
'storage',
],
commands: {
cache_site: {
description: '__MSG_cmd_cache_site__',
suggested_key: { default: isFirefox ? 'F4' : 'Ctrl+Shift+4' },
},
cache_siteAll: {
description: '__MSG_cmd_cache_siteAll__',
suggested_key: { default: isFirefox ? 'F6' : 'Ctrl+Shift+5' },
},
cache_browser: {
description: '__MSG_cmd_cache_browser__',
},
cache_browserAll: {
description: '__MSG_cmd_cache_browserAll__',
},
_execute_action: {
description: '__MSG_cmd_executeAction__',
...(!isDev && { suggested_key: { default: 'Alt+Shift+A' } }),
},
openSidePanel: {
description: '__MSG_cmd_openSidePanel__',
// ...(!isDev && { suggested_key: { default: 'Alt+Shift+P' } }),
},
openExtPanel: {
description: '__MSG_cmd_openExtPanel__',
// ...(!isDev && { suggested_key: { default: 'Alt+Shift+W' } }),
},
openOptions: {
description: '__MSG_cmd_openOptions__',
suggested_key: { default: 'Alt+Shift+O' },
},
},
...(isFirefox
? {
browser_specific_settings: {
gecko: {
id: 'cache-cleaner@cssnr.com',
strict_min_version: '112.0', // manifest - background.type
data_collection_permissions: { required: ['none'] },
},
gecko_android: { strict_min_version: '120.0' }, // permissions.request
},
}
: { minimum_chrome_version: '127' }), // chrome.action.openPopup
}
},
// // https://wxt.dev/guide/essentials/config/browser-startup.html
// // NOTE: Configured in web-ext.config.ts
// webExt: { disabled: true },
// https://wxt.dev/guide/essentials/config/hooks
hooks: {
'build:manifestGenerated': (wxt, manifest) => {
console.log('build:manifestGenerated:', wxt.config.browser)
if (manifest.action) manifest.action.default_icon = manifest.icons
if (manifest.sidebar_action) manifest.sidebar_action.default_icon = manifest.icons
},
},
// https://wxt.dev/guide/essentials/config/vite.html
vite: () => ({
// NOTE: This silences bootstrap deprecation warnings
css: {
preprocessorOptions: {
scss: {
quietDeps: true,
silenceDeprecations: [
'import',
'color-functions',
'global-builtin',
'if-function',
],
},
},
},
}),
})