-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.js
49 lines (46 loc) · 1.14 KB
/
vite.config.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
47
48
49
import { defineConfig } from 'vite'
import reactPlugin from '@vitejs/plugin-react'
import compressionPlugin from 'vite-plugin-compression'
// https://vitejs.dev/config/
export default defineConfig({
// Define Dev Server (npx vite) settings
server: {
port: 4200,
hmr: true,
cors: true,
},
plugins: [
reactPlugin({
// Only run fast-refresh for src
fastRefresh: true,
include: 'src/**',
// Add extra emotion engine features
jsxImportSource: '@emotion/react',
}),
// Compress everything with Brotli while building, so we don't have to do it on the fly
compressionPlugin({
algorithm: 'brotliCompress',
filter: /\.(js|jsx|ts|tsx|css|svg|ico)$/i,
verbose: false,
}),
],
esbuild: {
target: 'esnext',
format: 'esm',
},
build: {
minify: true, // Set to false to disable minification entirely
target: 'esnext', // Assumes native dynamic imports support
sourcemap: 'inline',
},
test: {
environment: 'jsdom',
globals: true,
setupFiles: 'src/setupTests.ts',
},
resolve: {
alias: [
{ find: '@/', replacement: '/src/' },
],
}
})