feat(app): add web electron toolkit support
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user