-
Notifications
You must be signed in to change notification settings - Fork 15
/
manifest.config.ts
31 lines (29 loc) · 925 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
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.replace(/[^\d.-]+/g, "").split(/[.-]/);
export default defineManifest(async (env) => {
return {
name: env.mode === "development" ? "[开发环境] MR Extension" : "MR Extension",
description: "MR的浏览器插件",
version: `${major}.${minor}.${patch}.${label}`,
manifest_version: 3,
action: {
default_title: "点击打开",
default_popup: "popup.html",
},
background: {
service_worker: "src/background.ts",
type: "module",
},
host_permissions: ["*://*/*"],
permissions: ["cookies", "storage"],
icons: {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png",
},
version_name: version,
};
});