liuweiGL / vite-plugin-mkcert

Provide certificates for vite's https dev service.
https://www.npmjs.com/package/vite-plugin-mkcert
MIT License
541 stars 37 forks source link

Run in `configureServer`/`configurePreviewServer` hooks instead of `config` hook #91

Closed benmccann closed 1 week ago

benmccann commented 1 week ago

Describe the bug

The plugin shouldn't be invoked for things like building the production bundle or typechecking. Instead run it when we are using a server

Reproduction

git clone git@github.com:benmccann/threlte.git
cd threlte/packages/xr
git checkout pnpm9
pnpm install
pnpm check

It asks for "Sudo password:" eventhough all I'm doing is invoking the type checker

System Info

Used package manager: pnpm

liuweiGL commented 1 week ago

The plugin has specified the hook to run:

https://github.com/liuweiGL/vite-plugin-mkcert/blob/e783eee14ccc4058fe7319c07a6d4673ddbb78b5/plugin/index.ts#L16-L20