Package.json mentions using babel-node for serving node server.
Refer https://babeljs.io/docs/usage/cli/#babel-node
### Not meant for production use
You should not be using babel-node in production. It is unnecessarily heavy, with high memory usage due to the cache being stored in memory. You will also always experience a startup performance penalty as the entire app needs to be compiled on the fly.
Yes, but in package.json babel-cli just for devDependencies. Of course it won't be used in production.
For production, you can build with
$ yarn run build -- --release
then, run the application in build folder
$ node build/server.js
or, run it with pm2, nodemon or forever
@ucay sorry if a noob question, but according to the package.json doesn't using:
yarn run build -- --release
Actually execute:
"build": "babel-node tools/run build"
Which basically relies on babel-node?
@eduwass Yes, it's for development usage.
After you build it, it's create build/package.json without dev dependencies
In my case, I use 3 stage in a project.
yarn run start to run applicationyarn run start -- --release to check on production modeStaging (production testing)
yarn run start -- --release to run applicationyarn run build -- --release then upload to production (read more in tools/deploy.js)Production (in this stage, we don't need babel-node anymore)
node server.js to run application
Most helpful comment
@eduwass Yes, it's for development usage.
After you build it, it's create
build/package.jsonwithout dev dependenciesIn my case, I use 3 stage in a project.
yarn run startto run applicationyarn run start -- --releaseto check on production modeStaging (production testing)
yarn run start -- --releaseto run applicationyarn run build -- --releasethen upload to production (read more in tools/deploy.js)Production (in this stage, we don't need babel-node anymore)
node server.jsto run application