-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
36 lines (33 loc) · 1017 Bytes
/
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
// See: https://dev.to/robertobutti/laravel-artisan-serve-and-https-cb0
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
// 001 import the basicSsl Vite plugin
import basicSsl from '@vitejs/plugin-basic-ssl'
// 002 set the Laravel host and the port
const host = '127.0.0.1';
const port = '8000';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
// 003 load the basicSsl plugin
basicSsl()
],
// 004 set the server section
server: {
// 005 enabling the HTTPS
https: true,
// 006 setting the proxy with Laravel as target (origin)
proxy: {
'^(?!(\/\@vite|\/resources|\/node_modules))': {
target: `http://${host}:${port}`,
}
},
host,
port: 5173,
// 007 be sure that you have the Hot Module Replacement
hmr: { host },
}
});