0.13.0 β€’ Published 9 days ago

code-inspector-core v0.13.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 days ago

NPM version NPM Downloads MIT-license GITHUB-language GITHUB star

πŸ“– Introduction

Click the element on the page, it can automatically open the code editor and position the cursor to the source code of the element.

code-inspector

πŸ’» Try it out online

🎨 Support

The following are which compilers, web frameworks and editors we supported now:

  • The following bundlers are currently supported: βœ… webpack βœ… vite βœ… rspack / rsbuild βœ… nextjs / nuxt / umijs eg.
  • The following Web frameworks are currently supported: βœ… vue2 βœ… vue3 βœ… react βœ… preact βœ… solid βœ… qwik βœ… svelte βœ… astro
  • The following code editors are currently supported: VSCode | Visual Studio Code - Insiders | WebStorm | Atom | HBuilderX | PhpStorm | PyCharm | IntelliJ IDEA

πŸš€ Install

npm i code-inspector-plugin -D
# or
yarn add code-inspector-plugin -D
# or
pnpm add code-inspector-plugin -D

🌈 Usage

Please check here for more usage information: code-inspector-plugin configuration

  • 1.Configuring Build Tools

    // webpack.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = () => ({
      plugins: [
        codeInspectorPlugin({
          bundler: 'webpack',
        }),
      ],
    });
    // vite.config.js
    import { defineConfig } from 'vite';
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default defineConfig({
      plugins: [
        codeInspectorPlugin({
          bundler: 'vite',
        }),
      ],
    });
    // rspack.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = {
      // other config...
      plugins: [
        codeInspectorPlugin({
          bundler: 'rspack',
        }),
        // other plugins...
      ],
    };
    // rsbuild.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = {
      // other config...
      tools: {
        rspack: {
          plugins: [
            codeInspectorPlugin({
              bundler: 'rspack',
            }),
          ],
        },
      },
    };
    // vue.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    module.exports = {
      // ...other code
      chainWebpack: (config) => {
        config.plugin('code-inspector-plugin').use(
          codeInspectorPlugin({
            bundler: 'webpack',
          })
        );
      },
    };

    For nuxt3.x :

    // nuxt.config.js
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    // https://nuxt.com/docs/api/configuration/nuxt-config
    export default defineNuxtConfig({
      vite: {
        plugins: [codeInspectorPlugin({ bundler: 'vite' })],
      },
    });

    For nuxt2.x :

    // nuxt.config.js
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default {
      build: {
        extend(config) {
          config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
          return config;
        },
      },
    };
    // next.config.js
    const { codeInspectorPlugin } = require('code-inspector-plugin');
    
    const nextConfig = {
      webpack: (config, { dev, isServer }) => {
        config.plugins.push(codeInspectorPlugin({ bundler: 'webpack' }));
        return config;
      },
    };
    
    module.exports = nextConfig;
    // umi.config.js or umirc.js
    import { defineConfig } from '@umijs/max';
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default defineConfig({
      chainWebpack(memo) {
        memo.plugin('code-inspector-plugin').use(
          codeInspectorPlugin({
            bundler: 'webpack',
          })
        );
      },
      // other config
    });
    // astro.config.mjs
    import { defineConfig } from 'astro/config';
    import { codeInspectorPlugin } from 'code-inspector-plugin';
    
    export default defineConfig({
      vite: {
        plugins: [codeInspectorPlugin({ bundler: 'vite' })],
      },
    });
  • 2.Configuring VSCode Command Line Tool

    Tip: Skip for Windows or other IDEs This step is only required for Mac with vscode as IDE. Skip this step if your computer is Windows or if you use another IDE.

    In VSCode, press command + shift + p, search for and click Shell Command: Install 'code' command in PATH:

    If you see the dialog box below, the configuration was successful:

  • 3.Enjoy using it

    When pressing the combination keys on the page, moving the mouse over the page will display a mask layer on the DOM with relevant information. Clicking will automatically open the IDE and position the cursor to the corresponding code location. (The default combination keys for Mac are Option + Shift; for Windows, it's Alt + Shift, and the browser console will output related combination key prompts)

πŸ‘¨β€πŸ’» Contributors

Special thanks to the contributors of this project:

πŸ“§ Communication and Feedback

For any usage issues, please leave a message below my Twitter post or submit an issue on Github.

For Chinese users, you can you can join the QQ group 769748484 add the author's WeiXin account zhoulx1688888 for consultation and feedback:

πŸ’– Sponsor

Sponsoring this project can help the author create better. If you are willing, thanks for sponsoring me through here.

0.13.0

9 days ago

0.12.2

15 days ago

0.12.1

17 days ago

0.12.0

17 days ago

0.11.0

1 month ago

0.10.1

2 months ago

0.10.0-beta.1

2 months ago

0.10.0

2 months ago

0.9.3

2 months ago

0.9.0

2 months ago

0.9.2

2 months ago

0.9.1

2 months ago

0.9.2-beta.2

2 months ago

0.9.2-beta.1

2 months ago

0.8.1

2 months ago

0.8.1-beta.1

2 months ago

0.8.1-beta.3

2 months ago

0.8.1-beta.2

2 months ago

0.8.0

3 months ago

0.8.0-beta.1

3 months ago

0.7.1-beta.1

3 months ago

0.6.5-beta.1

3 months ago

0.7.0

3 months ago

0.6.5

3 months ago

0.6.4

3 months ago

0.6.3

3 months ago

0.6.2

3 months ago

0.6.1

3 months ago

0.5.2

3 months ago

0.6.0

3 months ago

0.5.1

3 months ago

0.5.0

3 months ago

0.4.6

3 months ago

0.4.5

4 months ago

0.4.4

4 months ago

0.4.3

4 months ago

0.4.1-beta.2

4 months ago

0.4.1-beta.1

4 months ago

0.4.1

4 months ago

0.4.2

4 months ago

0.4.0-beta.1

4 months ago

0.4.0

4 months ago

0.3.2-beta.1

4 months ago

0.3.2

4 months ago

0.3.1

5 months ago

0.1.8-beta.1

10 months ago

0.1.10

9 months ago

0.1.11

9 months ago

0.1.12

8 months ago

0.1.13

6 months ago

0.1.0

10 months ago

0.3.0

5 months ago

0.1.2

10 months ago

0.2.0

5 months ago

0.1.1

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.9

9 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.0.20

10 months ago

0.0.21

10 months ago

0.0.17

10 months ago

0.0.18

10 months ago

0.0.19

10 months ago

0.0.15-beta.1

10 months ago

0.0.10

11 months ago

0.0.11

11 months ago

0.0.12

11 months ago

0.0.13

11 months ago

0.0.14

11 months ago

0.0.15

11 months ago

0.0.9

11 months ago

0.0.16

11 months ago

0.0.8

11 months ago

0.0.5

11 months ago

0.0.7

11 months ago

0.0.6

11 months ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago