-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwxt.config.ts
More file actions
60 lines (53 loc) · 1.73 KB
/
Copy pathwxt.config.ts
File metadata and controls
60 lines (53 loc) · 1.73 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
import {defineConfig} from 'wxt';
const isE2E = process.env.VITE_DF_E2E === '1';
const e2eHostPermissionsMode = process.env.E2E_HOST_PERMISSIONS ?? 'strict';
const defaultEntrypoints = ['background', 'content', 'offscreen'] as const;
const e2eEntrypoints = [...defaultEntrypoints, 'test-activate'] as const;
export default defineConfig({
modules: ['@wxt-dev/module-react', '@wxt-dev/auto-icons'],
srcDir: '.',
outDir: '.output',
manifestVersion: 3,
filterEntrypoints: isE2E ? [...e2eEntrypoints] : [...defaultEntrypoints],
manifest: ({browser}) => {
const hostPermissions =
isE2E && e2eHostPermissionsMode === 'broad'
? ['http://*/*', 'https://*/*']
: undefined;
const permissions = [
'storage',
'downloads',
'activeTab',
'scripting',
'contextMenus',
];
if (browser !== 'firefox') {
permissions.push('offscreen');
}
if (isE2E) {
permissions.push('tabs');
}
return {
name: 'Designer Feedback',
description:
'Annotate any webpage and share visual feedback with developers',
permissions,
content_security_policy: {
extension_pages: "script-src 'self'; object-src 'none';",
},
action: {
default_title: 'Click to toggle Designer Feedback',
},
...(hostPermissions ? {host_permissions: hostPermissions} : {}),
// CSS must be accessible from all URLs for runtime content script injection
web_accessible_resources: [
{
resources: ['content-scripts/content.css'],
matches: ['http://*/*', 'https://*/*'],
},
],
};
},
// Maintain old output directory structure for E2E tests
outDirTemplate: '{{browser}}-mv{{manifestVersion}}',
});