@open-editor/rollup
TypeScript icon, indicating that this package has built-in type declarations

0.8.4ย โ€ขย Publicย โ€ขย Published

@open-editor/rollup

NPM version MIT

A rollup plugin for fast find source code.

Valid only during development, requires Node.js version 14+.

Install

npm i @open-editor/rollup -D

Usage

// rollup.config.ts
import OpenEditor from '@open-editor/rollup';

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

Configuration

interface Options {
  /**
   * source rootDir path
   *
   * @default process.cwd()
   */
  rootDir?: string;
  /**
   * render the toggle into the browser
   *
   * @default true
   */
  displayToggle?: boolean;
  /**
   * set UI color mode
   *
   * @default 'system'
   */
  colorMode?: 'system' | 'light' | 'dark';
  /**
   * Disable hover effect from CSS when inspector is enabled
   *
   * @default true
   */
  disableHoverCSS?: boolean;
  /**
   * The inspector remains rendered when the browser is idle
   *
   * @default true
   */
  retainFrame?: boolean;
  /**
   * Ignoring components in some directories, using glob pattern syntax for matching
   *
   * @see https://en.wikipedia.org/wiki/Glob_(programming)
   *
   * @default '\/**\/node_modules\/**\/*'
   */
  ignoreComponents?: string | string[];
  /**
   * exit the check after opening the editor or component tree
   *
   * @default true
   */
  once?: boolean;
  /**
   * Internal server configuration
   */
  server?: {
    /**
     * enable https
     *
     * @see https://nodejs.org/api/tls.html#tls_tls_createsecurecontext_options
     */
    https?: {
      key: string;
      cert: string;
    };
  };
  /**
   * custom openEditor handler
   *
   * @default 'launch-editor'
   */
  onOpenEditor?(file: string): void;
}

Playgrounds

Source code Online trial
rollup/react15 StackBlitz
rollup/vue2 StackBlitz

/@open-editor/rollup/

    Package Sidebar

    Install

    npm i @open-editor/rollup

    Weekly Downloads

    95

    Version

    0.8.4

    License

    MIT

    Unpacked Size

    8.77 kB

    Total Files

    6

    Last publish

    Collaborators

    • zjxxxxxxxx