zthxxx / react-dev-inspector

jump to local IDE code directly from browser React component by just a simple click
https://react-dev-inspector.zthxxx.me
MIT License
1.16k stars 68 forks source link

fix docs #140

Closed SyMind closed 1 year ago

SyMind commented 1 year ago
  1. 应将 react-dev-inspector 安装至 dependencies,因为 process.env.NODE_ENVproduction 时不会安装 devDependencies,编译时 webpack 会因为无法找到依赖而报错。
  2. 示例代码中的 <Inspector /> 组件未自闭合。
vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
react-dev-inspector ❌ Failed (Inspect) Feb 2, 2023 at 3:28AM (UTC)
zthxxx commented 1 year ago

这个组件正常的话不应该在 webpack build 时用到 (tree-sharking deadcode-delete 处理),所以感觉应该装在 devDependencies 中,

不过对于 app 项目来说,只要不是 SSR ,dependencies / devDependencies 实际使用区别不大,你说的不安装 devDependencies 只在 npm install --omit=dev 时会有这种行为,不知道你是什么场景这么用到?