-
-
Save muath-ye/a7c8306b68eac2fadf916674ae025e98 to your computer and use it in GitHub Desktop.
Using Vite in combination with Valet's secured sites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite'; | |
import laravel from 'laravel-vite-plugin'; | |
import fs from 'fs'; | |
import { resolve } from 'path'; | |
import { homedir } from 'os'; | |
let host = 'sendstack.test'; | |
let homeDir = homedir(); | |
let serverConfig = {}; | |
if (homeDir) { | |
serverConfig = { | |
https: { | |
key: fs.readFileSync(resolve(homeDir, `.config/valet/Certificates/${host}.key`)), | |
cert: fs.readFileSync(resolve(homeDir, `.config/valet/Certificates/${host}.crt`)), | |
}, | |
hmr: { | |
host: 'sendstack.test', | |
}, | |
host: 'sendstack.test', | |
}; | |
} | |
export default defineConfig({ | |
plugins: [laravel([ | |
'resources/js/app.js' | |
])], | |
server: serverConfig, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To Use
APP_URL
from.env
file in Laravel project