-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
72 lines (70 loc) · 1.93 KB
/
vite.config.js
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
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import path from 'path';
import laravel from 'laravel-vite-plugin';
import fs from 'fs';
import browsersync from "vite-plugin-browser-sync";
const host = 'kayak-map.test';
export default defineConfig({
plugins: [
vue(),
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: true,
}),
],
optimizeDeps: {
include: ['vue', 'vue-router', 'vuetify', 'leaflet', 'axios', 'vue-leaflet-markercluster']
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js'),
'@assets': path.resolve(__dirname, 'storage/app/public/assets')
}
},
build: {
manifest: true,
outDir: 'public/build',
rollupOptions: {
input: 'resources/js/app.js',
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name.endsWith('.eot') ||
assetInfo.name.endsWith('.woff') ||
assetInfo.name.endsWith('.ttf')) {
return 'fonts/[name][extname]';
}
return 'assets/[name]-[hash][extname]';
}
}
}
},
server: {
host: '0.0.0.0',
port: 5173,
https: {
key: fs.readFileSync(`./docker/ssl/cert.key`),
cert: fs.readFileSync(`./docker/ssl/cert.crt`),
},
headers: {
'Access-Control-Allow-Origin': '*',
},
hmr: {
host: 'localhost',
proxy: host
},
watch: {
usePolling: true,
},
proxy: {
'/api': {
target: 'https://nginx',
changeOrigin: true,
secure: false,
},
},
}
});