Giter Site home page Giter Site logo

dmyz / vite-plugin-mkcert Goto Github PK

View Code? Open in Web Editor NEW

This project forked from liuweigl/vite-plugin-mkcert

0.0 0.0 0.0 757 KB

Provide certificates for vite's https dev service.

Home Page: https://www.npmjs.com/package/vite-plugin-mkcert

License: MIT License

TypeScript 97.76% CSS 0.95% HTML 1.29%

vite-plugin-mkcert's Introduction

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

localhost

127.0.0.1

localhost

Quick start

  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
  },
  plugins: [mkcert()]
})

Parameters

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.

hosts

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

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. mkcert save directory: PLUGIN_DATA_DIR
  2. Uninstall the CA certificate: mkcert -uninstall

Thanks

vite-plugin-mkcert's People

Contributors

liuweigl avatar semantic-release-bot avatar alexandrebonaventure avatar jeremycook avatar tolu avatar blacksunset avatar iulo avatar xiaweiss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.