Skip to content

skymoonya/rsbuild-plugin-mkcert

 
 

Repository files navigation

rsbuild-plugin-mkcert

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

Effect

View

localhost

127.0.0.1

localhost

Quick start

  1. Installation dependencies
yarn add rsbuild-plugin-mkcert -D
  1. Configure rsbuild
import {defineConfig} from'@rsbuild/core'
import mkcert from'rsbuild-plugin-mkcert'

// https://rsbuild.dev/config/
export default defineConfig({
  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.

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=rsbuild: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

About

Provide certificates for rsbuild's https dev service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 98.0%
  • HTML 1.1%
  • CSS 0.9%