WebChat/vite.config.ts
2023-07-31 00:36:44 +08:00

27 lines
579 B
TypeScript

import path from 'node:path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { crx } from '@crxjs/vite-plugin'
import manifest from './manifest'
import packageJson from './package.json'
const isDev = process.env.NODE_ENV === 'development'
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
define: {
__DEV__: isDev,
__NAME__: JSON.stringify(packageJson.name)
},
plugins: [
react(),
// @ts-expect-error use local package
crx({
manifest
})
]
})