-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
44 lines (42 loc) · 1 KB
/
vite.config.ts
File metadata and controls
44 lines (42 loc) · 1 KB
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 react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import svgr from 'vite-plugin-svgr'
// Plugin to print current config name during development
const printConfigPlugin = () => ({
configResolved(config: { command: string }) {
if (config.command === 'serve') {
const configName = process.env.VITE_CONFIG_NAME
if (configName) {
const configFile = `config.${configName}.json`
// eslint-disable-next-line no-console
console.log(`\n🔧 Using config: ${configFile}\n`)
} else {
// eslint-disable-next-line no-console
console.log(`\n🔧 Using config: config.json\n`)
}
}
},
name: 'print-config',
})
// https://vitejs.dev/config/
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
plugins: [
react(),
svgr({
svgrOptions: {
icon: true,
},
}),
printConfigPlugin(),
],
server: {
port: 4000,
},
})