-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwxt.config.ts
More file actions
85 lines (80 loc) · 1.91 KB
/
wxt.config.ts
File metadata and controls
85 lines (80 loc) · 1.91 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
import { defineConfig, type UserManifest } from "wxt";
import packageJson from "./package.json";
// See https://wxt.dev/api/config.html
export default defineConfig({
// hooks: {
// "build:manifestGenerated"(wxt, manifest) {
// if (wxt.config.mode === "development") {
// manifest.content_scripts ??= [];
// manifest.content_scripts.push({
// matches: ["http://*/*", "https://*/*"],
// js: ["content-scripts/content.js"],
// });
// }
// },
// },
manifest({ browser }) {
const [author, email] = packageJson.author.split(" ");
let manifest: UserManifest = {
name: packageJson.name,
description: packageJson.description,
homepage_url: packageJson.homepage,
permissions: ["activeTab", "clipboardWrite", "downloads", "storage"],
};
if (browser === "firefox") {
manifest.browser_specific_settings = {
gecko: {
id: "amgiflol@sm17p.me",
strict_min_version: "132.0",
},
};
manifest.developer = {
name: author,
url: packageJson.repository,
};
// @ts-ignore
manifest.author = author;
} else {
manifest.author = { email };
manifest.offline_enabled = true;
manifest.minimum_chrome_version = "130.0";
}
return manifest;
},
modules: [
"@wxt-dev/module-svelte",
"@wxt-dev/unocss",
"@wxt-dev/analytics/module",
"@wxt-dev/auto-icons",
],
outDir: "dist",
srcDir: "src",
svelte: {
vite: {
compilerOptions: {
runes: true,
},
},
},
vite: (_env) => ({
build: {
sourcemap: "inline",
minify: false,
},
optimizeDeps: {
entries: ["src/entrypoints/**/*.html"],
},
}),
webExt: {
openConsole: true,
openDevtools: true,
chromiumPort: 57540,
chromiumArgs: ["--user-data-dir=./.wxt/chrome-data"],
keepProfileChanges: true,
// firefoxArgs: ["--user-data-dir=./.wxt/firefox-data"],
startUrls: ["https://wxt.dev/guide/essentials/entrypoints.html"],
},
zip: {
excludeSources: ["tmp/*", "*.env*"],
},
});