-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.js
46 lines (42 loc) · 984 Bytes
/
vite.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
import compression from 'vite-plugin-compression-v2';
import historyFallback from 'connect-history-api-fallback';
// Ekledik
const app = require('./data.js'); // Express uygulamasını içe aktar
const getConfig = ({ command, mode }) => ({
server: {
host: '0.0.0.0',
hmr: {
clientPort: 443,
},
middleware: [
// connect-history-api-fallback middleware'i ekleyin
historyFallback(),
],
},
plugins: [
react(),
legacy(),
compression({
verbose: true,
disable: false,
threshold: 10240,
filter: /\.(js|css|html|svg)$/,
}),
],
build: {
rollupOptions: {
output: {
manualChunks: {
react: ['react', 'react-dom'],
},
},
},
chunkSizeWarningLimit: 1000,
},
});
app.listen(3000, () => {
console.log(`Sunucu 3000 portunda çalışıyor.`);
});
export default getConfig;