-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanifest.config.ts
40 lines (37 loc) · 1020 Bytes
/
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
import {defineManifest} from "@crxjs/vite-plugin";
import packageJson from "./package.json";
const {version, name: packageName} = packageJson;
// Convert from Semver (example: 0.1.0-beta6)
const [major, minor, patch, label = "0"] = version
// can only contain digits, dots, or dash
.replace(/[^\d.-]+/g, "")
// split into version parts
.split(/[.-]/);
export const manifest = defineManifest(async (env) => ({
manifest_version: 3,
icons: {
"128": "icons/logo-128.png"
},
name:
env.mode === "staging"
? `[INTERNAL] ${packageName}`
: packageName,
// up to four numbers separated by dots
version: `${major}.${minor}.${patch}.${label}`,
// semver is OK in "version_name"
version_name: version,
content_scripts: [{
js: ["src/pages/content.tsx"],
matches: ["https://*.lionelhorn.com/*"],
}],
background: {
service_worker: "src/background.ts",
type: "module",
},
action: {
"default_popup": "popup.html",
},
permissions: [
"storage",
],
}));