-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwxt.config.ts
More file actions
51 lines (49 loc) · 1.38 KB
/
wxt.config.ts
File metadata and controls
51 lines (49 loc) · 1.38 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
import { viteStaticCopy } from 'vite-plugin-static-copy'
import { defineConfig } from 'wxt'
const wasmPath = 'node_modules/fcitx5-js/dist/'
export default defineConfig({
manifest: {
name: '__MSG_extName__',
default_locale: 'en',
description: '__MSG_extDescription__',
permissions: [
'input',
],
input_components: [{
name: '__MSG_imName__',
type: 'ime',
id: 'fcitx5',
description: '__MSG_imDescription__',
language: ['en-US'],
layouts: ['us'],
}],
content_security_policy: {
extension_pages: "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';", // eslint-disable-line style/quotes
},
},
outDirTemplate: 'fcitx5-chrome',
modules: ['@wxt-dev/auto-icons'],
autoIcons: {
baseIconPath: 'assets/fcitx.svg',
},
vite: () => ({
plugins: [
viteStaticCopy({
targets: ['Fcitx5.js', 'Fcitx5.data', 'Fcitx5.wasm', 'libFcitx5Config.so', 'libFcitx5Core.so', 'libFcitx5Utils.so'].map(file => ({
src: wasmPath + file,
dest: '',
})),
}),
],
build: {
rollupOptions: {
external: ['fcitx5-js'], // Don't bundle Fcitx5.js so that it can be reused by options.
output: {
paths: {
'fcitx5-js': '../Fcitx5.js', // Convert import from 'fcitx5-js' to import from '../Fcitx5.js'.
},
},
},
},
}),
})