-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
78 lines (77 loc) · 1.92 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import { defineConfig } from 'vite';
import { visualizer } from 'rollup-plugin-visualizer';
import react from '@vitejs/plugin-react-swc';
import tsconfigpaths from 'vite-tsconfig-paths';
import removeConsole from 'vite-plugin-remove-console';
import imageminMozjpeg from 'imagemin-mozjpeg';
import imageminPngQuant from 'imagemin-pngquant';
import viteImagemin from '@vheemstra/vite-plugin-imagemin';
import imageminSvgo from 'imagemin-svgo';
import prerender from '@prerenderer/rollup-plugin';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
prerender({
routes: [
'/',
'/start',
'/follow',
'/mypage',
'/notification',
'/post',
'/post/register',
'/posts',
'/search',
'/profile',
'/coffee',
'/report',
'/support/customerCenter',
'/support/notice',
'/support/TOS',
'/support/privacyPolicy'
],
renderer: '@prerenderer/renderer-puppeteer',
server: {
port: 3000,
host: 'localhost'
},
rendererOptions: {
maxConcurrentRoutes: 1,
renderAfterTime: 500
},
postProcess(renderedRoute) {
renderedRoute.html = renderedRoute.html
.replace(/http:/i, 'https:')
.replace(
/(https:\/\/)?(localhost|127\.0\.0\.1):\d*/i,
'ddocker.kro.kr/'
);
}
}),
tsconfigpaths(),
removeConsole(),
visualizer({
open: true
}),
viteImagemin({
plugins: {
jpg: imageminMozjpeg(),
png: imageminPngQuant(),
svg: imageminSvgo()
}
})
],
build: {
rollupOptions: {
output: {
manualChunks: id => {
if (id.indexOf('node_modules') !== -1) {
const module = id.split('node_modules/').pop().split('/')[0];
return `vendor-${module}`;
}
}
}
}
}
});