-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
42 lines (42 loc) · 972 Bytes
/
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
import { defineConfig, loadEnv } from 'vite';
import path from 'path';
import vue from '@vitejs/plugin-vue';
import type { ImportMetaEnv } from './.env';
import eslintPlugin from 'vite-plugin-eslint';
// https://vite.dev/config/
export default defineConfig(({ mode }) => {
const env: Record<keyof ImportMetaEnv, string> = loadEnv(mode, process.cwd());
const serverUrl = env.VITE_SERVER_URL;
return {
server: {
host: '0.0.0.0',
port: 3000,
proxy: {
'/api': {
target: serverUrl,
},
},
},
plugins: [
vue(),
eslintPlugin({
include: ['src/**/*.ts', 'src/**/*.js', 'src/**/*.vue', 'src/*.ts', 'src/*.vue'],
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
'@views': path.resolve(__dirname, 'src/views'),
'@assets': path.resolve(__dirname, 'src/assets'),
},
},
envDir: '.',
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler', // or "modern"
},
},
},
};
});