Skip to content

Commit 8180782

Browse files
committed
fix(@updateURL): use meta.js file
1 parent e8d9eed commit 8180782

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

vite.config.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { defineConfig } from "vite";
2-
import monkey from "vite-plugin-monkey";
2+
import monkey, { cdn } from "vite-plugin-monkey";
3+
import { name } from "./package.json";
34

45
export default defineConfig({
56
plugins: [
67
monkey({
78
entry: "src/index.ts",
9+
build: {
10+
metaFileName: true,
11+
},
812
userscript: {
913
name: "GitHub Feed Back",
1014
icon: "https://github.githubassets.com/favicons/favicon.svg",
@@ -14,10 +18,14 @@ export default defineConfig({
1418
"https://github.com/?*",
1519
"https://github.com/dashboard*",
1620
],
17-
updateURL:
18-
"https://registry.npmmirror.com/github-feed-back/latest/files/dist/github-feed-back.user.js",
19-
downloadURL:
20-
"https://registry.npmmirror.com/github-feed-back/latest/files/dist/github-feed-back.user.js",
21+
downloadURL: cdn.npmmirror(undefined, `dist/${name}.user.js`)[1](
22+
"latest",
23+
name,
24+
),
25+
updateURL: cdn.npmmirror(undefined, `dist/${name}.meta.js`)[1](
26+
"latest",
27+
name,
28+
),
2129
"run-at": "document-start",
2230
},
2331
}),

0 commit comments

Comments
 (0)