-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
64 lines (63 loc) · 2.11 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {defineConfig, UserConfig} from 'vite'
import * as path from "path";
import Components from 'unplugin-vue-components/vite';
import {createVuePlugin} from "vite-plugin-vue2";
import {VuetifyResolver} from "unplugin-vue-components/resolvers";
import eslintPlugin from "vite-plugin-eslint";
import viteCompression from 'vite-plugin-compression';
import EnvironmentPlugin from "vite-plugin-environment";
export default defineConfig(async ({ command, mode }): Promise<UserConfig> => {
return {
base: '/',
resolve: {
extensions: ['.ts', '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
alias: [
{
find: '@/',
replacement: `${path.resolve(__dirname, './src')}/`,
},
{
find: 'src/',
replacement: `${path.resolve(__dirname, './src')}/`,
},
],
},
plugins: [
EnvironmentPlugin({
"VUE_APP_SCHOOL_NAME": "ITIS Meucci",
"VUE_API_URL": "http://localhost:3000",
"VUE_API_WS_URL": "ws://localhost:3000",
}, { defineOn: 'import.meta.env' }),
// Vue2
// https://github.com/underfin/vite-plugin-vue2
createVuePlugin({
target: 'esnext',
}),
// unplugin-vue-components
// https://github.com/antfu/unplugin-vue-components
Components({
dts: false,
// auto import for directives
directives: false,
// resolvers for custom components
resolvers: [
// Vuetify
VuetifyResolver(),
],
}),
eslintPlugin({
fix: true,
}),
// compress assets
// https://github.com/vbenjs/vite-plugin-compression
viteCompression(),
],
server:{
open: false,
port: 3001,
hmr: {
port: 3001,
}
}
};
});