Serve & Build

Documentation of development server and build process

Installation

MatX React uses React Framework for development serve and build process

  • 1. Make sure if NodeJs is installed on your computer.
  • 2. Open terminal and navigate to root /matx-react directory and run npm install to install dependencies.
  • 3. Again in that terminal run npm install create-react-app to install React Framework.

Development server

Run npm start to start local development server. You will be automatically redirected to your default browser's page which contains you served site. Open http://localhost:3000/ in browser if browser doesn't open automatically.

If you want to access your served site from other device open http://192.168.10.171:3000 where 192.168.10.171 should be replaced with the IP Address of the host machine where your site is served. In this case all the device should be under same network

Build

Run npm run build to build your project. All files including compiled & minified css, js files will be stored in /build directory.

Troubleshooting

If Node.js is already installed, make sure you’re running v8 or up.

JavaScript dependencies sometimes get out of sync and inexplicable bugs start to happen. Follow these steps to give a fresh start to your development environment:

  • 1. The installed npm version must be at least v6.9.0 You can update your npm with: npm install npm -g (sudo may be required).
  • 2. Re-install dependencies: rm -Rf node_modules && npm install
  • 3. Run npm start
  • If this did not work, try running npm cache clean and repeat the above steps.