Skip to content

hunghg255/rsbuild-plugin-print

Repository files navigation

logo

A plugin print for Rsbuild

NPM Version NPM Downloads Minizip Contributors License

Install

npm i rsbuild-plugin-print -D
Rsbuild
// rsbuild.config.ts
import { pluginPrint } from 'rsbuild-plugin-print';

export default defineConfig({
  plugins: [
    pluginPrint({
      /* options */
    }),
  ],
});

Example: playground/


Options

import type * as kolorist from 'kolorist';

import type { Options as BoxenOptions } from 'boxen';

type Kolorist = Omit<typeof kolorist, 'SupportLevel' | 'options'>;

export type MessageValue = Omit<BoxenOptions, 'borderStyle'> & {
  text: string;
  url?: string;
} & {
  borderStyle?: BoxenOptions['borderStyle'] | 'none';
};

type Message =
  | string
  | MessageValue
  | ((
      kolorist: Kolorist,
    ) => string | MessageValue | Promise<string | MessageValue | void>);

export interface IPluginOptions {
  info?: Message[];
  hostQrcode?: boolean;
}

Demo

demo