nimbus-gui/vite.config.ts

42 lines
945 B
TypeScript
Raw Normal View History

2023-08-03 06:20:54 +00:00
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
2023-08-03 13:24:19 +00:00
import { tamaguiPlugin } from '@tamagui/vite-plugin';
2023-08-03 06:20:54 +00:00
export default defineConfig({
2023-08-03 13:24:19 +00:00
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',
},
},
},
});