-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwxt.config.ts
More file actions
71 lines (68 loc) · 2.24 KB
/
wxt.config.ts
File metadata and controls
71 lines (68 loc) · 2.24 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
import { defineConfig } from 'wxt';
import react from '@vitejs/plugin-react'; // Import the React plugin
import { InlineConfig } from 'vitest'; // Import Vitest type
// See https://wxt.dev/api/config.html
export default defineConfig({
srcDir: 'src', // Defining srcDir to allow for cleaner imports like @/lib
entrypointsDir: 'entrypoints',
vite: (env) => { // env can be used to differentiate between build, dev, etc.
const plugins = [react()];
let testConfig: { test?: InlineConfig } = {};
// Add Vitest config only when in test mode or if you want it available generally
// WXT doesn't have a direct "test" mode in its env, so we add it generally
// or you could use an environment variable to conditionally add this.
testConfig.test = {
globals: true,
environment: 'jsdom', // or 'happy-dom'
setupFiles: [], // if you need setup files
include: ['src/**/*.test.ts', 'entrypoints/**/*.test.ts'],
alias: { // Ensure aliases match tsconfig and vite config for consistency
'@/': new URL('./src/', import.meta.url).pathname,
'~/': new URL('./src/', import.meta.url).pathname,
},
};
return {
plugins,
// Spread the test config here
...testConfig,
};
},
manifest: {
name: 'ABScribeX',
version: '1.0',
description: 'Edit content with generative AI support',
permissions: [
"contextMenus",
"activeTab",
"scripting",
"storage",
"offscreen"
],
content_security_policy: {
extension_pages: "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; connect-src 'self' https://abtestingtools-frontend.up.railway.app;"
},
action: {
default_popup: 'popup/index.html',
default_icon: {
16: 'icon/16.png',
48: 'icon/48.png',
128: 'icon/128.png'
}
},
icons: {
16: 'icon/16.png',
48: 'icon/48.png',
128: 'icon/128.png'
},
options_ui: {
page: 'options.html',
open_in_tab: true
},
host_permissions: [
"<all_urls>"
]
// Content scripts are defined in their respective files using defineContentScript
// or automatically picked up if named *.content.ts in entrypoints/
},
modules: ['@wxt-dev/module-react'],
});