37 lines
708 B
TypeScript
37 lines
708 B
TypeScript
import path from 'node:path';
|
|
|
|
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vite';
|
|
|
|
const platformExtensions = [
|
|
'.web.tsx',
|
|
'.web.ts',
|
|
'.tsx',
|
|
'.ts',
|
|
'.web.jsx',
|
|
'.web.js',
|
|
'.jsx',
|
|
'.js',
|
|
'.json',
|
|
];
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: [{ find: /^react-native$/, replacement: 'react-native-web' }],
|
|
dedupe: ['react', 'react-dom', 'react-native-web'],
|
|
extensions: platformExtensions,
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ['react-native-safe-area-context'],
|
|
},
|
|
build: {
|
|
outDir: path.resolve(__dirname, 'dist/renderer'),
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: 5173,
|
|
},
|
|
});
|