创建了一个新的create-react-app项目后,当我在项目中运行npm start时,我遇到了一个很大的问题。Chrome React开发人员工具不会显示src文件夹中的所有文件。相反,它只显示文件夹./src Chrome React Developer Tools
我使用的是nodejs 6.10.1,create-react-app 1.3.0。
package.json:
{
"name": "test",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.16.1",
"bootstrap": "^3.3.7",
"prop-types": "^15.5.9",
"react": "^15.5.4",
"react-bootstrap": "^0.30.10",
"react-bootstrap-table": "^3.2.1",
"react-dom": "^15.5.4",
"react-redux": "^5.0.4",
"react-router": "^3.0.0",
"recharts": "^0.22.3",
"redux": "^3.6.0",
"redux-logger": "^3.0.1",
"redux-promise-middleware": "^4.2.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"react-scripts": "0.9.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}有什么建议可以解决这个问题吗?我查看了文档,但没有找到任何解决方案。
发布于 2020-03-03 19:10:44
你仍然可以使用VScode Chrome扩展来调试代码,但是这不是我最喜欢的调试前端应用程序的方式。
使用eject命令启用调试。在npm run eject之后,它会显示更多的配置供您编辑,其中之一是源映射类型(在webpack配置下)。一旦弹出,源代码映射类型就会发生变化,从而允许您在chrome-dev-tools上进行调试。
https://stackoverflow.com/questions/44323391
复制相似问题