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

0.9.4 • Public • Published

@open-editor/vite

NPM version MIT

A vite plugin for fast find source code.

Home

Install

npm i @open-editor/vite -D

Usage

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

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

Options

/**
 * 插件配置选项 | Plugin Configuration Options
 */
export interface Options {
  /**
   * 源代码根目录路径 | Source code root directory path
   *
   * @default `process.cwd()`
   *
   * @example
   * ```ts
   * rootDir: path.resolve(__dirname, 'src')
   * ```
   */
  rootDir?: string;

  /**
   * 在浏览器显示切换按钮 | Display toggle button in browser
   *
   * @default `true`
   *
   * @remarks
   * 控制是否在页面右下角显示调试开关 | Controls whether to show debug toggle at bottom-right corner
   */
  displayToggle?: boolean;

  /**
   * 禁用 CSS 悬停效果 | Disable CSS hover effects
   *
   * @default `true`
   *
   * @remarks
   * 当检查器启用时禁用元素悬停高亮 | Disable element highlighting on hover when inspector is active
   */
  disableHoverCSS?: boolean;

  /**
   * 忽略指定目录的组件 | Ignore components in specified directories
   *
   * @default `'\/**\/node_modules\/**\/*'`
   *
   * @see [Glob Pattern Syntax](https://en.wikipedia.org/wiki/Glob_(programming))
   *
   * @remarks
   * 使用 glob 模式匹配需要忽略的路径 | Use glob patterns to match ignored paths
   */
  ignoreComponents?: string | string[];

  /**
   * 单次检查模式 | Single-inspection mode
   *
   * @default `true`
   *
   * @remarks
   * 打开编辑器或组件树后自动退出检查状态 | Automatically exit inspection after opening editor or component tree
   */
  once?: boolean;

  /**
   * 跨 iframe 交互支持 | Cross-iframe interaction
   *
   * @default `true`
   *
   * @remarks
   * 允许在子 iframe 中提升操作到父窗口(仅限同源)| Enable elevating operations from child iframes to parent window (same-origin only)
   */
  crossIframe?: boolean;

  /**
   * 自定义编辑器打开处理器 | Custom editor opening handler
   *
   * @default `内置的 launch-editor 实现 | Built-in launch-editor implementation`
   *
   * @remarks
   * 覆盖默认的文件打开逻辑 | Override default file opening behavior
   */
  onOpenEditor?(file: string, errorCallback: (errorMessage: string) => void): void;
}

Playgrounds

Source code Online trial
vite/react Open in StackBlitz
vite/vue Open in StackBlitz
vite/nuxt Open in StackBlitz

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.9.4156latest
1.0.0-beta.30beta

Version History

VersionDownloads (Last 7 Days)Published
1.0.0-beta.30
1.0.0-beta.20
1.0.0-beta.10
1.0.0-beta.00
0.9.4156
0.9.30
0.9.22
0.9.10
0.9.00
0.8.84
0.8.70
0.8.60
0.8.50
0.8.40
0.8.30
0.8.20
0.7.40
0.7.30
0.7.20
0.7.00
0.6.40
0.6.30
0.6.20
0.6.10
0.6.00
0.5.30
0.5.20
0.5.00
0.4.10
0.4.00
0.3.00
0.2.10
0.2.00
0.1.00
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20

Package Sidebar

Install

npm i @open-editor/vite

Weekly Downloads

120

Version

0.9.4

License

MIT

Unpacked Size

12.9 kB

Total Files

6

Last publish

Collaborators

  • zjxxxxxxxx