简体   繁体   中英

Create-react-app npm run build too slow

I am relatively new to using React and am following create-react-app tutorials. I am creating a simple webchat service using socket.io, React, and Express in a Node environment.

I've finished writing the majority of the features for the React app and am now working on the server end to connect the apps via Socket.io. Working on the front-end was each because I could just run "npm start" to serve a dev version of my app. However, now that I am working on the server side, implementing Socket.io, whenever I find an issue on the front-end, I have to rerun "npm run build" which takes ~15-30 seconds each time.

I am sure there is a faster way to debug issues like this without having to compile my react app into static files every time. Please advise.

You should run the front end using npm command on cmd panel npm start and debug the backend server side using VSCode Debugger using the node js extension. This way you can run both on dev easily. Plus it give you advance debugging features.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM