-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.config.ts
34 lines (32 loc) · 945 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
import { defineManifest } from "@crxjs/vite-plugin";
import packageJson from "./package.json";
const { version } = 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 default defineManifest({
manifest_version: 3,
name: "__MSG_appName__",
description: "__MSG_appDesc__",
version: `${major}.${minor}.${patch}.${label}`,
version_name: version,
default_locale: "en",
background: {
service_worker: "src/background.ts",
type: "module",
},
action: {
default_popup: "popup.html",
default_icon: "images/icon16-gray.png",
},
options_page: "options.html",
permissions: ["declarativeNetRequest", "activeTab", "storage"],
icons: {
16: "images/icon16.png",
48: "images/icon48.png",
128: "images/icon128.png",
},
});