-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
wxt.config.ts
93 lines (89 loc) · 1.97 KB
/
wxt.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
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
import { defineConfig } from "wxt"
import react from "@vitejs/plugin-react"
import topLevelAwait from "vite-plugin-top-level-await"
const chromeMV3Permissions = [
"storage",
"sidePanel",
"activeTab",
"scripting",
"declarativeNetRequest",
"action",
"unlimitedStorage",
"contextMenus",
"tts",
"notifications"
]
const firefoxMV2Permissions = [
"storage",
"activeTab",
"scripting",
"unlimitedStorage",
"contextMenus",
"webRequest",
"webRequestBlocking",
"notifications",
"http://*/*",
"https://*/*",
"file://*/*"
]
// See https://wxt.dev/api/config.html
export default defineConfig({
vite: () => ({
plugins: [
react(),
topLevelAwait({
promiseExportName: "__tla",
promiseImportName: (i) => `__tla_${i}`
}) as any
],
build: {
rollupOptions: {
external: ["langchain", "@langchain/community"]
}
}
}),
entrypointsDir: "entries",
srcDir: "src",
outDir: "build",
manifest: {
version: "1.3.8",
name:
process.env.TARGET === "firefox"
? "Page Assist - A Web UI for Local AI Models"
: "__MSG_extName__",
description: "__MSG_extDescription__",
default_locale: "en",
action: {},
author: "n4ze3m",
browser_specific_settings:
process.env.TARGET === "firefox"
? {
gecko: {
id: "page-assist@nazeem"
}
}
: undefined,
host_permissions:
process.env.TARGET !== "firefox"
? ["http://*/*", "https://*/*", "file://*/*"]
: undefined,
commands: {
_execute_action: {
description: "Open the Web UI",
suggested_key: {
default: "Ctrl+Shift+L"
}
},
execute_side_panel: {
description: "Open the side panel",
suggested_key: {
default: "Ctrl+Shift+P"
}
}
},
permissions:
process.env.TARGET === "firefox"
? firefoxMV2Permissions
: chromeMV3Permissions
}
}) as any