2023-11-05 18:56:50 +00:00
|
|
|
import path from 'node:path'
|
2023-11-04 18:18:09 +00:00
|
|
|
import { defineConfig } from 'wxt'
|
|
|
|
import react from '@vitejs/plugin-react'
|
2024-09-27 05:53:50 +00:00
|
|
|
import { name, displayName, homepage } from './package.json'
|
2024-09-27 05:45:29 +00:00
|
|
|
import svgr from 'vite-plugin-svgr'
|
2023-11-04 18:18:09 +00:00
|
|
|
|
|
|
|
export default defineConfig({
|
2023-11-05 18:56:50 +00:00
|
|
|
srcDir: path.resolve('src'),
|
2023-11-30 08:50:18 +00:00
|
|
|
imports: false,
|
2024-09-16 07:47:36 +00:00
|
|
|
entrypointsDir: 'app',
|
2023-11-04 18:18:09 +00:00
|
|
|
runner: {
|
|
|
|
startUrls: ['https://www.example.com/']
|
|
|
|
},
|
2024-09-30 13:39:47 +00:00
|
|
|
manifest: ({ browser }) => {
|
2024-09-29 07:34:10 +00:00
|
|
|
const common = {
|
|
|
|
name: displayName,
|
2024-10-12 20:11:37 +00:00
|
|
|
permissions: ['storage', 'notifications'],
|
2024-09-29 07:34:10 +00:00
|
|
|
homepage_url: homepage,
|
|
|
|
icons: {
|
|
|
|
'16': 'logo.png',
|
|
|
|
'32': 'logo.png',
|
|
|
|
'48': 'logo.png',
|
|
|
|
'128': 'logo.png'
|
|
|
|
}
|
2024-09-27 05:45:29 +00:00
|
|
|
}
|
2024-09-29 07:34:10 +00:00
|
|
|
return {
|
|
|
|
chrome: {
|
|
|
|
...common
|
|
|
|
},
|
|
|
|
firefox: {
|
|
|
|
...common,
|
|
|
|
browser_specific_settings: {
|
|
|
|
gecko: {
|
|
|
|
id: 'molvqingtai@gmail.com'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}[browser]
|
2023-12-01 05:33:49 +00:00
|
|
|
},
|
2024-09-27 00:20:49 +00:00
|
|
|
vite: (env) => ({
|
2023-11-04 18:18:09 +00:00
|
|
|
define: {
|
2024-09-27 00:20:49 +00:00
|
|
|
__DEV__: env.mode === 'development',
|
2023-11-04 18:18:09 +00:00
|
|
|
__NAME__: JSON.stringify(name)
|
|
|
|
},
|
2024-09-27 05:45:29 +00:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
svgr({
|
|
|
|
include: '**/*.svg'
|
|
|
|
})
|
|
|
|
]
|
2023-11-04 18:18:09 +00:00
|
|
|
})
|
|
|
|
})
|