A vite plugin for fast find source code.
Valid only during development, requires Node.js version 14+.
npm -D i @open-editor/vite
// vite.config.ts
import OpenEditor from '@open-editor/vite';
export default defineConfig({
plugins: [
OpenEditor({
/* options */
}),
// other plugins
],
});
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;
/**
* exit the check after opening the editor or component tree
*
* @default true
*/
once?: boolean;
/**
* custom openEditor handler
*
* @default 'launch-editor'
*/
onOpenEditor?(file: string): void;
}
Source code | Online trial |
---|---|
vite/react |
StackBlitz |
vite/vue |
StackBlitz |
vite/nuxt |
StackBlitz |