2023-07-13 14:27:59 +00:00
|
|
|
import path from 'node:path'
|
2023-07-11 20:22:57 +00:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import react from '@vitejs/plugin-react'
|
2023-07-13 14:27:59 +00:00
|
|
|
import { crx } from '@crxjs/vite-plugin'
|
2023-07-11 20:22:57 +00:00
|
|
|
import Icons from 'unplugin-icons/vite'
|
2023-07-13 14:27:59 +00:00
|
|
|
import manifest from './manifest'
|
2023-07-13 17:07:14 +00:00
|
|
|
import packageJson from './package.json'
|
2023-07-11 20:22:57 +00:00
|
|
|
|
2023-07-13 14:27:59 +00:00
|
|
|
export default defineConfig({
|
2023-07-11 20:22:57 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2023-07-13 17:07:14 +00:00
|
|
|
'@': path.resolve(__dirname, './src')
|
2023-07-11 20:22:57 +00:00
|
|
|
}
|
|
|
|
},
|
2023-07-13 17:07:14 +00:00
|
|
|
define: {
|
|
|
|
__DEV__: process.env.NODE_ENV !== 'production',
|
|
|
|
__NAME__: JSON.stringify(packageJson.name)
|
|
|
|
},
|
2023-07-11 20:22:57 +00:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
// https://github.com/antfu/unplugin-icons
|
|
|
|
Icons({ compiler: 'jsx', jsx: 'react' }),
|
2023-07-13 14:27:59 +00:00
|
|
|
crx({ manifest })
|
|
|
|
]
|
|
|
|
})
|