Repository navigation
Expand file tree
/
Copy pathvite.config.ts
More file actions
48 lines (46 loc) · 1.58 KB
/
Copy pathvite.config.ts
File metadata and controls
48 lines (46 loc) · 1.58 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
import { defineConfig, lazyPlugins } from "vite-plus";
import monkey from "vite-plugin-monkey";
import { readFileSync } from "fs";
const pkg = JSON.parse(readFileSync("./package.json", "utf-8"));
export default defineConfig({
fmt: {},
lint: {
jsPlugins: [{ name: "vite-plus", specifier: "vite-plus/oxlint-plugin" }],
rules: { "vite-plus/prefer-vite-plus-imports": "error" },
options: { typeAware: true, typeCheck: true },
},
plugins: lazyPlugins(() => [
monkey({
entry: "src/index.ts",
userscript: {
name: "Better Search ⭐",
namespace: "https://github.com/quantavil/userscript/better-search",
version: pkg.version,
description: pkg.description,
author: "quantavil",
license: "GPL-3.0-or-later",
// Single regex for all Google TLDs — no 200-line @match list
include: [
/^https?:\/\/(?:www\.)?google\.[a-z]{2,6}(?:\.[a-z]{2,3})?\/search/,
"*://www.bing.com/search*",
"*://*.bing.com/search*",
"*://duckduckgo.com/*",
"*://*.duckduckgo.com/*",
"*://search.brave.com/search*",
/^https?:\/\/(?:[a-z]+\.)?yandex\.[a-z]{2,}\/search/,
/^https?:\/\/(?:[a-z]+\.)?ya\.ru\/search/,
],
grant: ["GM_getValue", "GM_setValue", "GM_registerMenuCommand", "GM_xmlhttpRequest"],
connect: ["gist.githubusercontent.com", "api.github.com"],
"run-at": "document-idle",
},
build: {
fileName: "better-search.user.js",
},
}),
]),
build: {
minify: false,
target: "es2022",
},
});