百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
V

vite-plugin-mkcert

> 编程语言
开源

为 vite 的 https 开发服务提供证书。

764 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

为 vite 的 https 开发服务提供证书。

中文文档

vite-plugin-mkcert

Use mkcert to provide certificate support for vite https development services.

When should I use this plugin

  1. When you want to use http/2 to solve the concurrency limit of vite http dev server requests, you find that the browser cache is invalid #2725.
  2. I have obsessive-compulsive disorder, and I hope that the browser will not show annoying https certificate errors.

Effect

View

Quick start

Requirements

  • Node.js >= 22.19.0
  1. Installation dependencies
yarn add vite-plugin-mkcert -D
  1. Configure vite
import {defineConfig} from 'vite'
import mkcert from 'vite-plugin-mkcert'

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    https: true
  }, // Not needed for Vite 5+ (simply omit this option)
  plugins: [mkcert()]
})

Parameters

hosts

Custom hosts, default value is localhost + local ip addrs.

force

Whether to force generate.

autoUpgrade

Whether to automatically upgrade mkcert.

source

Specify the download source of mkcert, domestic users can set it to coding to download from the coding.net mirror, or provide a custom BaseSource.

mkcertPath

If the network is restricted, you can specify a local mkcert file instead of downloading from the network.

proxy

Proxy URL used when downloading the mkcert binary.

Example: http://127.0.0.1:7890

If not provided, it will fallback to environment variables: HTTPS_PROXY, https_proxy, HTTP_PROXY, http_proxy.

savePath

The location to save the files, such as the downloaded mkcert program and the generated CA file, private key and certificate file, etc. Default value is PLUGIN_DATA_DIR

keyFileName

The name of private key file generated by mkcert

certFileName

The name of cert file generated by mkcert

Mobile devices

For the certificates to be trusted on mobile devices, you will have to install the root CA. It's the rootCA.pem file in the folder printed by mkcert -CAROOT.

On iOS, you can either use AirDrop, email the CA to yourself, or serve it from an HTTP server. After opening it, you need to install the profile in Settings > Profile Downloaded and then enable full trust in it.

For Android, you will have to install the CA and then enable user roots in the development build of your app. See this StackOverflow answer.

Display the debugging information of the plug-in

Set the environment variable DEBUG=vite:plugin:mkcert

CHANGELOG

CHANGELOG

Principle

Use mkcert to install the local CA certificate and generate it for server.https Server certificate.

Friendly reminder

  1. Uninstall the CA certificate: mkcert -uninstall

Thanks

  • mkcert
  • daquinoaldo/https-localhost

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言