So I just learn't that there is a command that can create a react environment quickly and easily. And it includes the cool web server that reloads every time you edit your component code and also it has a build command to compile it to production.... A lot easier than following a multi-stage tutorial on how to install all the components individually. Just two commands and you are away. Firstly you need node installed and then you do the following two commands.
jmcd@jmitsmbp tmp $ npm install -g create-react-app jmcd@jmitsmbp tmp $ create-react-app jmits Creating a new React app in /Users/jmcd/tmp/jmits. Installing packages. This might take a couple minutes. Installing react-scripts from npm... Success! Created jmits at /Users/jmcd/tmp/jmits Inside that directory, you can run several commands: npm start Starts the development server. npm run build Bundles the app into static files for production. npm test Starts the test runner. npm run eject Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back! We suggest that you begin by typing: cd jmits npm start Happy hacking! jmcd@jmitsmbp tmp $ cd jmits jmcd@jmitsmbp tmp $ npm start Starting the development server... Compiled successfully! The app is running at: http://localhost:3000/ Note that the development build is not optimized. To create a production build, use npm run build.
0 Comments