Vite plugin that uses mkcert to automatically generate and trust locally valid HTTPS certificates for Vite's dev server. Current stable version is v2.0.0 (2026-04-09). Release cadence is frequent with several minor/patch versions per year. Key differentiators: zero-config setup, automatic local IP hosts, support for mobile device trust instructions, and a built-in mkcert binary downloader. Since v1.17.12, it replaced axios with native fetch, removing a long-standing supply chain risk. v2.0.0 requires Node.js >= 22.19.0 and Vite >= 3. Compared to alternatives like @vitejs/plugin-basic-ssl, this plugin provides a proper local CA that works across browsers and avoids browser security warnings.
npm install vite-plugin-mkcertVerified import paths — ran on the pinned version, not inferred.
Basic setup of vite-plugin-mkcert with Vite. Enables HTTPS dev server and auto-generates trusted certificates.
Upgrade Node.js to >=22.19.0
Use import or dynamic import() instead of require()
If you relied on axios-specific proxy options, switch to the new proxy option or environment variables (HTTPS_PROXY, HTTP_PROXY)
With Vite 5+, you can omit server: { https: true } and just use the pluginSet source: 'coding' for Chinese mirror, or provide mkcertPath to a local binary
Upgrade to v1.17.4+ which fixes path escaping, or avoid parentheses in folder names
Install mkcert manually or ensure the plugin can download it (check network/proxy settings)
Change to import mkcert from 'vite-plugin-mkcert' and ensure your project is ESM via "type": "module" in package.json
Run 'mkcert -install' or let the plugin automatically install the CA (requires admin/sudo)