Skip to content

psyirius/vite-plugin-secure-now

Repository files navigation

Vite Plugin Secure Now

Vite Plugin Secure Now 🎉

npm version license

A Vite plugin to get instant HTTPS for your development server.

Screenshots

Vite Console

Features

  • 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.

How It Works

This plugin configures Vite's dev server to use the ssl certificate from traefik.me to resolve to local ip addresses.

Installation

NPM

npm install vite-plugin-secure-now --save-dev

Yarn

yarn add vite-plugin-secure-now --dev

PNPM

pnpm add vite-plugin-secure-now --save-dev

Usage

// vite.config.js | vite.config.ts
import { defineConfig } from 'vite';
import secureNow from 'vite-plugin-secure-now';

export default defineConfig({
  plugins: [
    secureNow(),
  ],
});

Options

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;
}

Issues

If you encounter any issues, please open an issue on GitHub.

License

MIT

Authors

About

A Vite plugin to get instant https for your dev server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published