• Stars
    star
    151
  • Rank 246,057 (Top 5 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 2 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🦋 Jump to local IDE source code while click the element of browser automatically

NPM Version NPM Downloads License

👀 Why

When developing a React app, you have a lot of components in your app. Sometimes you may forget where the code is located that you want to edit. Then you need this plugin to help you find the code, just click the dom in the browser and this plugin can help you to open the editor and find the code.

📖 Introduction

This vite plugin allows users to jump to local IDE code directly from browser React component by just a simple click, which is similar to Chrome inspector but more advanced.

🌈 Features

  • Support react 16
  • Support react 17
  • Support react 18
  • All features out of box just need add this plugin in vite.config.ts

vite-plugin-vue-inspector

📦 Installation

# pnpm 
pnpm add vite-plugin-react-inspector -D

# yarn
yarn add vite-plugin-react-inspector -D

# npm
npm install vite-plugin-react-inspector -D

🦄 Usage

Configuration vite.config.ts

// ❗️this plugin must before react

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import ReactInspector from 'vite-plugin-react-inspector'

export default defineConfig({
  plugins: [
    ReactInspector(),
    react(),
  ],
})

Example

🔌 Configuration IDE / Editor

It uses an environment variable named REACT_EDITOR to specify an IDE application, but if you do not set this variable, it will try to open a common IDE that you have open or installed once it is certified.

For example, if you want it always open VSCode when inspection clicked, set export REACT_EDITOR=code in your shell.

VSCode

  • install VSCode command line tools, see the official docs install-vscode-cli

  • set env to shell, like .bashrc or .zshrc

    export REACT_EDITOR=code

WebStorm

  • just set env with an absolute path to shell, like .bashrc or .zshrc (only MacOS)

    export REACT_EDITOR='/Applications/WebStorm.app/Contents/MacOS/webstorm'

OR

  • install WebStorm command line tools

  • then set env to shell, like .bashrc or .zshrc

    export REACT_EDITOR=webstorm

Vim

Yes! you can also use vim if you want, just set env to shell

export REACT_EDITOR=vim

🌸 Credits

This project is inspired by vite-plugin-vue-inspector .

Partially implementation is inspired by vite-plugin-svelte-inspector .

👦 Author

sudongyuer email:[email protected]

❤️ Thanks Contribution

📄 License

MIT License © 2022 SuDongYu

More Repositories

1

learn-eslint

🦥 从0到1全面掌握ESLint
JavaScript
340
star
2

javascript-mental-models

💘 帮助你建立良好的JavaScript心智模型
TypeScript
198
star
3

easy-tinypng-cli

🐼 A cli can automatically compress images with tinypng.com
TypeScript
61
star
4

mini-slack

slack-mini版(react、redux、ts、firebase、styled-components、vite、pnpm)
TypeScript
59
star
5

vite-plugin-hot-export

🐝 A vite plugin automatically export files & HMR support
TypeScript
54
star
6

heimdall-ts

🏎 A CLI that can help to generate typescript API module easily
TypeScript
46
star
7

react-patterns

☄️ React相关der设计模式 (翻译)
Shell
45
star
8

mini-spotify

🎸 spotify音乐播放器(next.js、nextauth 、recoil、ts、tailwind、spotify api、middleware、pnpm)
TypeScript
35
star
9

tiny-svelte

🐈 Tiny svelte implement
JavaScript
34
star
10

toy-browser

🌍A toy-browser about emulates browser rendering^_^
JavaScript
29
star
11

unxlsx

🌸 A cli can automatically generate files from Excel files.
TypeScript
24
star
12

auto-export

✨ A cli can automatically export files of the same type
TypeScript
22
star
13

mini-vue3

JavaScript
20
star
14

window-channel

🌈 A very simple window communication library
TypeScript
20
star
15

eslint-config

🐇 Out of box Eslint config ~~
JavaScript
20
star
16

learn-vim

🐇 从0到1通关Vim
JavaScript
20
star
17

antd-table-2-xlsx

🐥 A very simple way to transform antd table to xlsx
TypeScript
18
star
18

movie-gallery

🍁 在线电影简评网站(TypeScript Next.js Tailwind Pnpm CssGrid Responsive react-flip-move react-modal Sass)
TypeScript
14
star
19

mini-vue-router

🐧A mini-vue-router , you kan learn the principle of vue-router
JavaScript
13
star
20

learn-monorepo

🕹 learn-monorepo
JavaScript
12
star
21

sudongyuer.github.io

我的个人站点https://sudongyuer.github.io/
JavaScript
8
star
22

turbo-cache-transport

👻 turbo cache remover
TypeScript
7
star
23

rsocketMan

🎸 A rsocket web devtools
TypeScript
5
star
24

sudongyuer

JavaScript
4
star
25

react-todolist

🐧一个react写的todolist
JavaScript
4
star
26

frontend-algorithm

🕹 前端应该掌握的一些算法和刷题笔记
JavaScript
4
star
27

vue3-todolist

🐧一个基于vue3 composation api 的 TODO List 小Demo
Vue
3
star
28

image-bed

3
star
29

front-end-roadmap

🐟🐟🐟前端学习路线图🐶🐱🦐
3
star
30

ts-starter

My ts starter
TypeScript
2
star
31

easy-switch

🌛moon ~ sun🌞
HTML
2
star
32

monsterlessonsacademy

JavaScript
2
star
33

tiny-unocss

TypeScript
2
star
34

vite-plugin-starter

TypeScript
2
star
35

info-js

TypeScript
2
star
36

element-plus-histoire

Vue
2
star
37

ast-explore

💅 AST 探索~
JavaScript
2
star
38

learn-go

Go
2
star
39

unplugin-hot-export

✨ Auto export files support webpack vite rollup esbuild
TypeScript
2
star
40

geek-time-prac

刻意练习
JavaScript
1
star
41

project-01

学习测试使用的代码仓库
1
star
42

jira

react practice project
TypeScript
1
star
43

cs61b-sp21

Java
1
star
44

love

TypeScript
1
star
45

eslint-starter

JavaScript
1
star
46

vitejs-vite-1mazom

Created with StackBlitz ⚡️
CSS
1
star
47

web_bigevent

创建大事件项目仓库
JavaScript
1
star
48

taskbox

🔥 storybook react UI library
JavaScript
1
star
49

dofiles

1
star
50

myHomeWork

JavaScript
1
star
51

lectureCode-sp21

Java
1
star
52

toutiao-m

头条移动端
Less
1
star