diff --git a/vite.config.ts b/vite.config.ts index 5a33944a..9f2b3618 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,7 +1,41 @@ import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import { tamaguiPlugin } from '@tamagui/vite-plugin'; -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [react()], -}) + plugins: [react(), tamaguiPlugin({ + config: './tamagui.config.ts', + components: ['tamagui'], + }), + // optional, adds the optimizing compiler: + // tamaguiExtractPlugin(tamaguiConfig), + ], + 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: { + alias: { + 'react-native': 'react-native-web', + } + }, + optimizeDeps: { + esbuildOptions: { + resolveExtensions: [ + '.web.js', + '.web.ts', + '.web.tsx', + '.js', + '.jsx', + '.json', + '.ts', + '.tsx', + '.mjs', + ], + loader: { + '.js': 'jsx', + }, + }, + }, +});