// vite.config.js
import vercel from 'vite-plugin-vercel';
import mkcert from'vite-plugin-mkcert'
import {defineConfig} from "vite";
console.log(import.meta.env)
export default defineConfig(({mode}) => ({
vercel: {
},
devServer: {
https: {
cert: './certs/cert.pem',
key: './certs/dev.pem'
}
},
plugins: [
mode === "development" && mkcert({
savePath: './certs', // save the generated certificate into certs directory
force: true, // force generation of certs even without setting https property in the vite config
}),
]
}))
when running through vite ssl on localhost works flawless, but when running trough the vercel dev layer withvercel dev`
❯ vercel dev
Vercel CLI 33.7.0
> Running Dev Command “vite --port $PORT”
The list of generated files:
/Users/.../certs/dev.pem
/Users/.../certs/cert.pem
VITE v5.2.8 ready in 482 ms
➜ Local: https://localhost:3000/
➜ Network: use --host to expose
➜ press h + enter to show help
> Ready! Available at http://localhost:3000
when running through
vite
ssl on localhost works flawless, but when running trough the vercel dev layerwith
vercel dev`accessing https://localhost:3000/ gives an
ERR_SSL_PROTOCOL_ERROR