forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.mjs
More file actions
48 lines (46 loc) · 1.35 KB
/
vite.config.mjs
File metadata and controls
48 lines (46 loc) · 1.35 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
45
46
47
48
import { defineConfig, loadEnv } from "vite";
import laravel from "laravel-vite-plugin";
import tailwindcss from "@tailwindcss/vite";
import vue from "@vitejs/plugin-vue2";
import { URL } from "node:url";
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '');
const appUrl = new URL(env.APP_URL || 'http://localhost');
return {
plugins: [
laravel({
publicDirectory: 'html',
input: ['resources/js/app.js'],
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
tailwindcss(),
],
resolve: {
alias: {
vue: 'vue/dist/vue.esm.js',
},
},
server: {
host: appUrl.hostname,
port: appUrl.port || 5173,
https: appUrl.protocol === 'https:',
cors: {
origin: appUrl.origin,
credentials: true,
},
hmr: {
host: appUrl.hostname,
protocol: appUrl.protocol.replace(':', ''),
port: appUrl.port || 5173,
},
},
};
});