-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathwxt.config.ts
More file actions
103 lines (100 loc) · 3.29 KB
/
wxt.config.ts
File metadata and controls
103 lines (100 loc) · 3.29 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
94
95
96
97
98
99
100
101
102
103
import { TanStackRouterVite } from '@tanstack/router-plugin/vite'
// import react from '@vitejs/plugin-react'
// import { nodePolyfills } from 'vite-plugin-node-polyfills'
// import path from 'node:path'
// import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'wxt'
// See https://wxt.dev/api/config.html
export default defineConfig({
imports: false,
srcDir: 'src',
// extensionApi: 'chrome',
// extensionApi: 'webextension-polyfill',
modules: ['@wxt-dev/module-react', '@wxt-dev/auto-icons'],
manifestVersion: 3,
manifest: ({ mode }) => {
const scriptSrc =
mode === 'production'
? "'self' 'wasm-unsafe-eval'"
: "'self' 'wasm-unsafe-eval' http://localhost:4000/ http://localhost:8097/"
const rpcEndpoints =
'https://eth.merkle.io/ https://ethereum-rpc.publicnode.com/ https://rpc.ankr.com/ https://nodes.mewapi.io/ https://mainnet.infura.io/ https://cloudflare-eth.com/ https://rpc.flashbots.net/ https://rpc.tenderly.co/ https://rpc.ethernode.com/ https://ethereum.publicnode.com/ https://eth.drpc.org/'
const connectSrc =
mode === 'production'
? `https://status-api-status-im-web.vercel.app/ https://status-api-status-im-web.vercel.app/api/ https://li.quest/ https://registry.npmjs.org/ ${rpcEndpoints}`
: `ws: http://localhost:3030/ https://localhost:3030/ https://li.quest/ https://registry.npmjs.org/ ${rpcEndpoints}`
return {
name: '!Status Portfolio Wallet (Beta)',
description:
'Easily view and manage your crypto portfolio in real time — Beta crypto wallet and Web3 portfolio tracker in one.',
permissions: ['storage', 'alarms', 'tabs', 'notifications'],
host_permissions: ['http://*/*', 'https://*/*'],
action: {},
web_accessible_resources: [
{
resources: ['/wallet-core.wasm'],
// fixme:
matches: ['<all_urls>'],
},
],
content_security_policy: {
extension_pages: `script-src ${scriptSrc}; object-src 'self'; connect-src 'self' ${connectSrc}`,
},
}
},
runner: {
disabled: true,
},
vite: () => ({
define: {
'process.env': {
ALCHEMY_API_KEYS: 'test',
INFURA_API_KEY: 'test',
COINGECKO_API_KEY: 'test',
MERCURYO_SECRET_KEY: 'test',
VERCEL: 'test',
VERCEL_ENV: 'test',
},
},
build: {
target: 'esnext',
},
// resolve: {
// alias: {
// // buffer: 'buffer/',
// '@/': path.resolve(__dirname, 'foo'),
// '@portfolio/': path.resolve(__dirname, '../../portfolio/src'),
// },
// },
plugins: [
// tsconfigPaths({
// // loose: true,
// }),
// react(),
TanStackRouterVite({
// target: 'react',
// autoCodeSplitting: true,
routeToken: '_layout',
}),
// nodePolyfills({
// // include: ['path', 'stream', 'util'],
// exclude: ['http'],
// globals: {
// // Buffer: true,
// global: true,
// process: true,
// },
// // overrides: {
// // fs: 'memfs',
// // },
// // protocolImports: true,
// }),
],
// build: {
// rollupOptions: {
// // external: ['buffer'],
// plugins: []
// },
// },
}),
})