-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathvite.config.ts
46 lines (44 loc) · 1.32 KB
/
vite.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
41
42
43
44
45
46
import { defineConfig, Plugin } from "vite";
import { crx } from "@crxjs/vite-plugin";
import pkg from "./package.json";
// https://github.com/crxjs/chrome-extension-tools/issues/846#issuecomment-1861880919
const viteManifestHackIssue846: Plugin & {
renderCrxManifest: (manifest: any, bundle: any) => void;
} = {
// Workaround from https://github.com/crxjs/chrome-extension-tools/issues/846#issuecomment-1861880919.
name: "manifestHackIssue846",
renderCrxManifest(_manifest, bundle) {
bundle["manifest.json"] = bundle[".vite/manifest.json"];
bundle["manifest.json"].fileName = "manifest.json";
delete bundle[".vite/manifest.json"];
},
};
export default defineConfig({
plugins: [
viteManifestHackIssue846,
crx({
manifest: {
manifest_version: 3,
name: "HTTP Indicator",
description: "Indicator for HTTP/2, QUIC and HTTP/3",
version: pkg.version,
homepage_url: "https://github.com/pd4d10/http-indicator",
icons: {
128: "icon.png",
},
background: {
service_worker: "src/background.ts",
},
content_scripts: [
{
matches: ["<all_urls>"],
js: ["src/content.ts"],
},
],
action: {
default_icon: "default.png",
},
},
}),
],
});