vite-plugin-shortcuts
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

vite-plugin-shortcuts


Installation

pnpm add vite-plugin-shortcuts

Usage

import { defineConfig } from 'vite';
import { shortcutsPlugin } from 'vite-plugin-shortcuts';

export default defineConfig({
  plugins: [
    shortcutsPlugin({
      shortcuts: [
        {
          key: 'c',
          description: 'close console',
          action: (server) => {
            server.config.logger.clearScreen('error');
          },
        },
        {
          key: 's',
          description: 'reset console',
          action: (server) => {
            server.config.logger.clearScreen('error');
            server.printUrls();
          },
        },
        // {
        //   key: 'r',
        //   description: 'restart the server',
        //   async action(server) {
        //     await server.restart();
        //   },
        // },
        // {
        //   key: 'u',
        //   description: 'show server url',
        //   action(server) {
        //     server.config.logger.info('');
        //     server.printUrls();
        //   },
        // },
        // {
        //   key: 'q',
        //   description: 'quit',
        //   async action(server) {
        //     await server.close().finally(() => process.exit());
        //   },
        // },
      ],
    }),
  ],
});

Package Sidebar

Install

npm i vite-plugin-shortcuts

Weekly Downloads

4

Version

0.1.0

License

MIT

Unpacked Size

15.5 kB

Total Files

12

Last publish

Collaborators

  • alqmc