-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
85 lines (82 loc) · 2.07 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { defineConfig } from 'vite';
import { resolve } from 'path';
import { viteVConsole } from 'vite-plugin-vconsole';
import eslintPlugin from 'vite-plugin-eslint';
import svgLoader from 'vite-svg-loader';
import vueTypeImports from 'vite-plugin-vue-type-imports';
import vue from '@vitejs/plugin-vue';
import vueI18n from '@intlify/vite-plugin-vue-i18n';
// https://vitejs.dev/config/
export default defineConfig({
envPrefix: 'FB_APP_PARAMETER__',
publicDir: false,
plugins: [
vue(),
vueTypeImports(),
vueI18n({
include: resolve(__dirname, './assets/locales/**.json'),
}),
viteVConsole({
entry: resolve('assets/main.ts'), // entry file
localEnabled: true, // dev environment
enabled: false, // build production
config: {
maxLogNumber: 1000,
theme: 'dark',
},
}),
//eslintPlugin(),
svgLoader(),
],
resolve: {
alias: {
'@fastybird': resolve(__dirname, './node_modules/@fastybird'),
'@': resolve(__dirname, './assets'),
},
dedupe: ['vue', 'pinia', 'vue-router', 'vee-validate', 'vue-i18n', 'vue-meta', 'nprogress', '@vueuse/core'],
},
css: {
modules: {
localsConvention: 'camelCaseOnly',
},
},
optimizeDeps: {
include: ['vue', 'pinia', 'vue-router', 'vee-validate', 'vue-i18n', 'vue-meta', 'nprogress', '@vueuse/core'],
},
build: {
outDir: 'public/dist',
},
server: {
proxy: {
'/api': {
target: 'http://miniserver.local',
rewrite: (path: string): string => {
const apiPrefix = '/api';
return path.replace(new RegExp(`^${apiPrefix}`, 'g'), ''); // Remove base path
},
secure: true,
changeOrigin: true,
},
'/ws-exchange': {
target: 'ws://localhost:8888',
rewrite: (path: string): string => {
const wsPrefix = '/ws-exchange';
return path.replace(new RegExp(`^${wsPrefix}`, 'g'), ''); // Remove base path
},
secure: true,
changeOrigin: true,
ws: true,
configure: (proxy) => {
console.log('CONFIGURE');
proxy.on('proxyReq', function (): void {
console.log('EVENT');
});
},
},
},
port: 3000,
},
preview: {
port: 3000,
},
});