Generate a temporary certificate from trusted ca, and start a vite dev server with https enable.
- To test functions which require https connection
- You want to start an https dev server for multiple projects but are tired of trusting certificates over and over again
- You want to share your projects in programing with your teammates
This plugin will rewrite the server.https
section in your vite config, and force to start https server
- get all your device's ipv4 addresses
- sign a cert for these addresses and
localhost
- start dev server with these addresses and
localhost
Insert example below into your vite config's plugin section.
autoCert({
ca: {
cert: "<provide your ca's cert>",
key: "<provide your ca's private key>",
},
});