A Vite plugin to get instant HTTPS for your development server.
- Instant HTTPS: Automatically sets up HTTPS for your Vite dev server.
- Easy Integration: Simple configuration and seamless integration with Vite.
- Secure Context Development: Develop for Secure contexts without any hassle.
This plugin configures Vite's dev server to use the ssl certificate from traefik.me to resolve to local ip addresses.
npm install vite-plugin-secure-now --save-dev
yarn add vite-plugin-secure-now --dev
pnpm add vite-plugin-secure-now --save-dev
// vite.config.js | vite.config.ts
import { defineConfig } from 'vite';
import secureNow from 'vite-plugin-secure-now';
export default defineConfig({
plugins: [
secureNow(),
],
});
interface Options {
/**
* Whether to enable HTTPS for the dev server.
* @default true
*/
dev?: boolean;
/**
* Whether to enable HTTPS for the preview server.
* @default true
*/
preview?: boolean;
/**
* The subdomain prefix for the HTTPS URL.
* You can use different combinations supported with: https://traefik.me/
* Note: The subdomain should not be nested.
* @default 'vite'
*/
prefix?: string;
}
If you encounter any issues, please open an issue on GitHub.