-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
executable file
·61 lines (59 loc) · 1.82 KB
/
vite.config.js
File metadata and controls
executable file
·61 lines (59 loc) · 1.82 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
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import fs from 'fs';
// Check if SSL certificates exist (development environment)
const sslKeyPath = '/opt/nestogy/server.key';
const sslCertPath = '/opt/nestogy/server.crt';
const hasSSL = fs.existsSync(sslKeyPath) && fs.existsSync(sslCertPath);
export default defineConfig({
server: {
host: '0.0.0.0',
port: 5173,
strictPort: true,
...(hasSSL && {
https: {
key: fs.readFileSync(sslKeyPath),
cert: fs.readFileSync(sslCertPath),
},
}),
hmr: {
host: hasSSL ? '10.0.3.179' : 'localhost',
port: 5173,
protocol: hasSSL ? 'wss' : 'ws',
},
cors: true,
},
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/css/client-portal.css',
'resources/js/app.js',
'resources/js/contract-clauses.js',
'resources/js/it-documentation-diagram.js',
'resources/js/components/settings.js',
'resources/js/legacy/quote-integration.js',
'resources/js/legacy/quote-integration-simple.js',
],
refresh: true,
}),
],
resolve: {
alias: {
'@': '/resources/js',
'~': '/resources',
},
},
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: ['axios'],
charts: ['chart.js'],
utils: ['date-fns', 'flatpickr', 'tom-select'],
terminal: ['@xterm/xterm', '@xterm/addon-fit', '@xterm/addon-search', '@xterm/addon-web-links'],
},
},
},
},
});