-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathwxt.config.webstore.ts
More file actions
93 lines (84 loc) · 2.62 KB
/
wxt.config.webstore.ts
File metadata and controls
93 lines (84 loc) · 2.62 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import { defineConfig } from 'wxt';
// Chrome Web Store configuration - removes features not supported by Chrome Web Store
export default defineConfig({
modules: ['@wxt-dev/module-react'],
outDir: 'build',
manifest: {
name: '__MSG_extension_name__',
description: '__MSG_description__',
default_locale: 'zh_CN',
version: '3.0.0',
author: 'fydeos',
// Icons
icons: {
16: '/icon-16.png',
32: '/icon-32.png',
48: '/icon-48.png',
64: '/icon-64.png',
128: '/icon-128.png'
},
// Action with default icon (for toolbar button)
action: {
default_icon: {
16: '/icon-16.png',
32: '/icon-32.png',
48: '/icon-48.png',
64: '/icon-64.png',
128: '/icon-128.png'
}
},
// Permissions - REMOVED private permissions for Chrome Web Store
permissions: [
'storage',
'unlimitedStorage',
'input'
// NOTE: Removed virtualKeyboardPrivate and inputMethodPrivate (not available on Web Store)
],
// Content Security Policy for WASM
content_security_policy: {
extension_pages: "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';"
},
// IME-specific configuration - MODIFIED for Chrome Web Store
input_components: [
{
name: '__MSG_input_method_name__',
id: 'fyde-rhythm',
// NOTE: Removed 'indicator' (not supported on Chrome Web Store)
language: ['zh-CN', 'zh', 'en', 'jp', 'ko', 'zh-TW'],
layouts: ['us']
// NOTE: Removed 'input_view' (custom virtual keyboard not supported on Chrome Web Store)
}
]
// NOTE: Removed 'update_url' (managed by Chrome Web Store)
} as any,
// Vite configuration
vite: () => ({
build: {
// Don't inline WASM files
assetsInlineLimit: 0,
// Increase chunk size warning limit (our options page is legitimately large)
chunkSizeWarningLimit: 1500, // 1500 kB instead of default 500 kB
rollupOptions: {
output: {
// Keep WASM file names predictable
assetFileNames: (assetInfo) => {
if (assetInfo.name?.endsWith('.wasm')) {
return '[name].[ext]';
}
return 'assets/[name]-[hash].[ext]';
}
},
// Suppress eval warning from lottie-web (third-party library, safe in our context)
onwarn(warning, warn) {
if (
warning.code === 'EVAL' &&
warning.id?.includes('lottie-web')
) {
return; // Suppress lottie-web eval warning
}
warn(warning); // Show other warnings
}
}
}
})
});