-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
vite.config.mjs
55 lines (54 loc) · 1.11 KB
/
vite.config.mjs
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'node:path'
import autoprefixer from 'autoprefixer'
export default defineConfig(() => {
return {
base: './',
build: {
outDir: 'build',
},
css: {
postcss: {
plugins: [
autoprefixer({}), // add options if needed
],
},
preprocessorOptions: {
scss: {
quietDeps: true,
silenceDeprecations: ['import', 'legacy-js-api'],
},
},
},
esbuild: {
loader: 'jsx',
include: /src\/.*\.jsx?$/,
exclude: [],
},
optimizeDeps: {
force: true,
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
plugins: [react()],
resolve: {
alias: [
{
find: 'src/',
replacement: `${path.resolve(__dirname, 'src')}/`,
},
],
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.scss'],
},
server: {
port: 3000,
proxy: {
// https://vitejs.dev/config/server-options.html
},
},
}
})