-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
68 lines (65 loc) · 1.8 KB
/
vite.config.js
File metadata and controls
68 lines (65 loc) · 1.8 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { defineConfig } from 'vite';
import fs from 'fs';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';
import vuetify from 'vite-plugin-vuetify';
import dotenv from 'dotenv';
import dotenvExpand from 'dotenv-expand';
import path from 'path';
import {viteStaticCopy} from "vite-plugin-static-copy";
// Load and expand env vars (supports ${VAR} syntax)
const env = dotenv.config();
dotenvExpand.expand(env);
const host = `${process.env.VITE_API_URL ?? 'http://localhost:3000'}`;
const port = `${process.env.VITE_PORT ?? '3000'}`;
console.log('Start vite!!!')
console.log(`Vite server running on ${host}:${port}`);
export default defineConfig({
plugins: [
laravel({
input: [
'resources/sass/app.scss',
'resources/js/app.js'
],
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
vuetify({
autoImport: true,
}),
viteStaticCopy({
targets: [
{
src: 'node_modules/circle-flags/flags/',
dest: 'images'
}
]
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'resources/js'),
}
},
server: {
https: {
key: fs.readFileSync('docker/certificates/docker.dev.key'),
cert: fs.readFileSync('docker/certificates/docker.dev.crt'),
},
host: true,
port: port,
cors: true,
origin: `https://openshift.docker.dev:${port}`,
hmr: {
host: host,
protocol: 'wss'
},
},
});