-
Notifications
You must be signed in to change notification settings - Fork 1
/
vite.config.ts
44 lines (42 loc) · 1 KB
/
vite.config.ts
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
import path from 'path';
import { defineConfig } from 'vite';
import puppeteerRenderer from '@prerenderer/renderer-puppeteer';
import prerender from '@prerenderer/rollup-plugin';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
react(),
prerender({
routes: [
'/',
'/signin',
'/introduce',
'/apply',
'/apply/frontend',
'/apply/backend',
'/apply/ai',
'/apply/android',
'/apply/designer',
],
renderer: puppeteerRenderer,
rendererOptions: {
maxConcurrentRoutes: 1,
renderAfterTime: 500,
},
postProcess(route) {
route.html = route.html
.replace(/http:/g, 'https:')
.replace(
/(https:\/\/)?(localhost|127\.0\.0\.1):\d*/g,
'https://gdsc-knu.com/'
);
},
}),
],
resolve: {
alias: [{ find: '@gdg', replacement: path.resolve(__dirname, 'src') }],
},
define: {
global: {},
},
});