mirror of
https://github.com/chathub-dev/chathub.git
synced 2025-09-26 20:31:18 +08:00
37 lines
855 B
TypeScript
37 lines
855 B
TypeScript
import { crx } from '@crxjs/vite-plugin'
|
|
import react from '@vitejs/plugin-react'
|
|
import jotaiDebugLabel from 'jotai/babel/plugin-debug-label'
|
|
import jotaiReactRefresh from 'jotai/babel/plugin-react-refresh'
|
|
import { defineConfig } from 'vite'
|
|
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
import manifest from './manifest.config'
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
return {
|
|
plugins: [
|
|
tsconfigPaths(),
|
|
react({
|
|
babel: {
|
|
plugins: [jotaiDebugLabel, jotaiReactRefresh],
|
|
},
|
|
}),
|
|
crx({ manifest }),
|
|
],
|
|
build: {
|
|
rollupOptions: {
|
|
input: ['app.html'],
|
|
},
|
|
},
|
|
esbuild: {
|
|
drop: mode === 'production' ? ['console', 'debugger'] : [],
|
|
},
|
|
server: {
|
|
strictPort: true,
|
|
port: 5173,
|
|
hmr: {
|
|
clientPort: 5173,
|
|
},
|
|
},
|
|
}
|
|
})
|