I am developing a React JS app on a remote server which uses Apache.
In the past I have built a React JS app manually with webpack/babel etc. and then used "npm run dev" to run the app.
With this method I could see any errors on the fly in the terminal and test in the browser automatically through the web browser.
I am now creating a new site with create-react-app which takes care of a lot of the tedious setup for you. One thing I cannot figure out is how to use something similar to "npm run dev". My two options seem to be:
What can I do so that I get the best of both worlds? Having quick rebuilds / error reporting and being able to see remotely through my Apache server?
Or would it be better just to go back to my old manual way of doing things?
This issue has been resolved over the last five years (when this question was posted). It seems to me that npm start does the same job as npm run dev at least with the latest version of npm and node that i am running. ([email protected] and [email protected]).
When I hit save in my editor (VScode) the terminal (on windows [i haven't tested on Linux]) gets updated right away and so does my browser - errors and all.
Due to the lack of documentation on the npm run dev command, one could only assume that it has been deprecated.
Another alternative to the above mentioned commands, would be to use Yarn which also does a great job of compiling your code, and in my own personal experience has done a better job at tougher projects, than npm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With