-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
68 lines (66 loc) · 1.71 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { crx, defineManifest } from '@crxjs/vite-plugin';
import { defineConfig } from 'vite';
const manifest = defineManifest({
manifest_version: 3,
name: 'GitHub-VideoPlayer',
description: 'GitHubのコントリビューション履歴のテーブルで動画を再生するプログラムです',
version: '1.0.0',
permissions: [
'storage',
'activeTab',
],
host_permissions: [
'*://github.com/*',
'*://*.github.com/*'
],
web_accessible_resources: [
{
matches: [
'https://github.com/*'
],
resources: [
"videos/*.*",
],
}
],
content_scripts: [
{
matches: [
'https://github.com/*'
],
js: [
'src/index.ts',
'src/videoPlayer.ts'
],
run_at: 'document_start'
}
],
action: {
default_title: 'GitHub-VideoPlayer',
default_popup: 'src/popup/popup.html', // ポップアップ用のHTMLファイル
default_icon: {
"128": "public/images/logo-128.png"
}
}
});
export default defineConfig({
plugins: [crx({ manifest })],
build: {
rollupOptions: {
input: {
popup: 'src/popup/popup.html',
}
},
outDir: 'dist',
emptyOutDir: true,
},
// WebSocket connection to 'ws://localhost/' failed: というエラーの対策
// https://github.com/crxjs/chrome-extension-tools/issues/746#issuecomment-1647484887
server: {
port: 5174,
strictPort: true,
hmr: {
port: 5174,
},
},
});