51 lines
1.1 KiB
TypeScript
51 lines
1.1 KiB
TypeScript
import { defineConfig } from 'wxt';
|
|
|
|
// See https://wxt.dev/api/config.html
|
|
export default defineConfig({
|
|
modules: ['@wxt-dev/module-react'],
|
|
manifest: {
|
|
name: 'Testing Tools',
|
|
version: '1.0',
|
|
description: '测试工具',
|
|
permissions: [
|
|
'storage',
|
|
'unlimitedStorage',
|
|
'clipboardWrite',
|
|
'activeTab',
|
|
'scripting',
|
|
'tabs',
|
|
'cookies',
|
|
'sidePanel',
|
|
'contextMenus',
|
|
],
|
|
host_permissions: ['<all_urls>'],
|
|
action: {
|
|
default_title: 'Testing Tools',
|
|
},
|
|
side_panel: {
|
|
default_path: 'entrypoints/sidepanel/index.html',
|
|
},
|
|
options_ui: {
|
|
page: 'entrypoints/options/index.html',
|
|
open_in_tab: true,
|
|
},
|
|
},
|
|
vite: () => ({
|
|
build: {
|
|
// 1. 切换压缩器为 terser
|
|
minify: 'terser',
|
|
|
|
// 2. 配置 terser 强制转义所有非 ASCII 字符
|
|
terserOptions: {
|
|
format: {
|
|
ascii_only: true,
|
|
comments: false,
|
|
},
|
|
},
|
|
|
|
// 3. 调整 chunk 大小警告阈值
|
|
chunkSizeWarningLimit: 600,
|
|
},
|
|
}),
|
|
});
|