Files
page-agent/packages/extension/wxt.config.js
T

70 lines
2.0 KiB
JavaScript
Raw Normal View History

import tailwindcss from '@tailwindcss/vite'
2026-02-02 21:11:23 +08:00
import { mkdirSync, readFileSync } from 'node:fs'
import { defineConfig } from 'wxt'
2026-01-20 18:56:39 +08:00
const chromeProfile = '.wxt/chrome-data'
mkdirSync(chromeProfile, { recursive: true })
2026-02-02 21:11:23 +08:00
const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'))
// See https://wxt.dev/api/config.html
export default defineConfig({
srcDir: 'src',
modules: ['@wxt-dev/module-react'],
2026-01-21 14:04:26 +08:00
webExt: {
2026-01-20 18:56:39 +08:00
chromiumProfile: chromeProfile,
keepProfileChanges: true,
2026-01-26 16:16:04 +08:00
chromiumArgs: ['--hide-crash-restore-bubble'],
2026-01-20 18:56:39 +08:00
},
vite: () => ({
plugins: [tailwindcss()],
2026-02-02 21:11:23 +08:00
define: {
__VERSION__: JSON.stringify(pkg.version),
2026-02-02 21:11:23 +08:00
},
2026-01-24 19:29:27 +08:00
optimizeDeps: {
force: true,
},
2026-01-21 14:04:26 +08:00
build: {
minify: false,
2026-01-21 14:04:26 +08:00
chunkSizeWarningLimit: 2000,
cssCodeSplit: true,
rollupOptions: {
onwarn: function (message, handler) {
if (message.code === 'EVAL') return
handler(message)
},
},
},
}),
2026-03-07 23:29:12 +08:00
zip: {
artifactTemplate: 'page-agent-ext-{{version}}-{{browser}}.zip',
},
manifest: {
2026-03-18 01:56:56 +08:00
key: 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqbzT0iTYeYlnCvDJIGDnGU8oarJgZILDzSfLi/ufuSxXEPDKuMyD892GhvrMCZNVHS11Sh6NYUOc/PcUOhtaR2urHtcNkrpSJNV10zUamY7fxBdVEkOucfyLu8INVy+teis62MoRWYPaUPkfZUjrLGW8MsZ9aFzARfu9GGDEp2EAYsWDN6w6vyz9LJ82pm542EWnVT4MjmDPgvYFCWGBtaU/dfHD+GAX6URJFapsCvryVURKJ+76c/GO9/I3EX1IBfbY6dec78bLCMvVxiTmiv36KyGPwX1OpakW8IiCpXWdbAxjm+plbYlp5t5zTyyoE3sOSFeXsBH0Kg27o8GcvQIDAQAB',
2026-02-14 16:51:37 +08:00
default_locale: 'en',
name: '__MSG_extName__',
description: '__MSG_extDescription__',
homepage_url: 'https://alibaba.github.io/page-agent/',
2026-01-24 19:29:27 +08:00
permissions: ['tabs', 'tabGroups', 'sidePanel', 'storage'],
host_permissions: ['<all_urls>'],
2026-01-20 18:56:39 +08:00
icons: {
64: 'assets/page-agent-64.png',
},
action: {
2026-02-14 16:51:37 +08:00
default_title: '__MSG_extActionTitle__',
},
web_accessible_resources: [
{
resources: ['main-world.js'],
matches: ['*://*/*'],
},
],
side_panel: {
default_path: 'sidepanel/index.html',
},
2026-03-18 01:56:56 +08:00
externally_connectable: {
matches: ['http://localhost/*'],
},
},
})