-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
39 lines (37 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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import viteCompression from 'vite-plugin-compression';
import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
// import generateSitemap from 'sitemap-ts';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
plugins: [
['@swc/plugin-styled-components', { displayName: false, ssr: true }],
],
}),
viteCompression(),
ViteImageOptimizer({
cache: true,
cacheLocation: 'cache-images',
test: /(?<!\$)\.(jpe?g|png|gif|tiff|webp|svg|avif)$/i,
}),
],
resolve: {
alias: [
{ find: '@', replacement: resolve(__dirname, 'src') },
{ find: '#', replacement: resolve(__dirname, 'src/components') },
],
},
base: process.env.NODE_ENV === 'production' ? process.env.BASE_URL : void 0,
build: {
minify: 'terser',
terserOptions: {
format: {
comments: false,
},
},
},
});