2023-08-03 06:20:54 +00:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
|
2023-08-07 07:47:22 +00:00
|
|
|
const extensions = ['.web.js', '.web.ts', '.web.tsx', '.js', '.jsx', '.json', '.ts', '.tsx', '.mjs']
|
|
|
|
|
2023-08-03 06:20:54 +00:00
|
|
|
export default defineConfig({
|
2023-08-04 06:43:07 +00:00
|
|
|
plugins: [react()],
|
2023-08-03 13:24:19 +00:00
|
|
|
define: {
|
|
|
|
DEV: `${process.env.NODE_ENV === 'development' ? true : false}`,
|
|
|
|
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
|
|
|
'process.env.TAMAGUI_TARGET': JSON.stringify('web'),
|
|
|
|
},
|
|
|
|
resolve: {
|
2023-08-07 07:47:22 +00:00
|
|
|
extensions,
|
2023-08-03 13:24:19 +00:00
|
|
|
alias: {
|
|
|
|
'react-native': 'react-native-web',
|
2023-08-04 06:43:07 +00:00
|
|
|
},
|
2023-08-03 13:24:19 +00:00
|
|
|
},
|
|
|
|
optimizeDeps: {
|
|
|
|
esbuildOptions: {
|
2023-08-07 07:47:22 +00:00
|
|
|
resolveExtensions: extensions,
|
2023-08-03 13:24:19 +00:00
|
|
|
loader: {
|
|
|
|
'.js': 'jsx',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2023-08-04 06:43:07 +00:00
|
|
|
})
|