@open-editor/webpack
v0.9.0
Published
๐ A webpack plugin for fast find source code.
Downloads
318
Maintainers
Readme
@open-editor/webpack
A webpack plugin for fast find source code.
Valid only during development, requires Node.js version 14+.
Install
npm i @open-editor/webpack -D
Usage
// webpack.config.js
const OpenEditorWebpackPlugin = require('@open-editor/webpack');
module.exports = {
plugins: [
new OpenEditorWebpackPlugin({
/* options */
}),
// other plugins
],
};
Configuration
interface Options {
/**
* source rootDir path
*
* @default process.cwd()
*/
rootDir?: string;
/**
* render the toggle into the browser
*
* @default true
*/
displayToggle?: boolean;
/**
* Disable hover effect from CSS when inspector is enabled
*
* @default true
*/
disableHoverCSS?: 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;
/**
* Enable interaction between multiple iframes to be promoted to the top-level window.
*
* It only takes effect when the top window and iframe window have the same origin.
*
* @default false
*/
crossIframe?: 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 |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| webpack/react
| StackBlitz |
| webpack/nextjs
| StackBlitz |
| webpack/vue
| StackBlitz |
| webpack/nuxt
| StackBlitz |