EggBornJS provides corresponding npm scripts for different running environments

Unit-test Environment

Unit Test

$ npm run test:backend

Code Coverage

$ npm run cov:backend

Local Development Environment

Start backend service

$ npm run dev:backend

Start backend debug service

$ npm run debug:backend

Start frontend service

$ npm run dev:front

Production Environment

Start backend service

$ npm run start:backend
$ npm run start:backend -- --daemon --workers=2

Stop backend service

$ npm run stop:backend

Build Frontend

In the production environment, you must build frontend codes, and then configure the nginx service

$ npm run build:front
$ npm run build:front -- --scene={sceneName}

EggBornJS uses WebPack to build the frontend of the project. Because the EggBornJS project is composed of a series of business modules, the modules codes can be precompiled in advance, which can significantly improve the construction speed when building the frontend of the whole project

In practice, if a project contains 40 business modules, it will take 70 seconds to build according to the normal build mechanism. The precompiled mechanism can be completed in 20 seconds. This is of great engineering significance for the development of large-scale web projects