Skip to content

Instantly share code, notes, and snippets.

@AhmedCommando
Last active July 5, 2019 21:43
Show Gist options
  • Save AhmedCommando/834cf58e0495317dda8e152409d5d623 to your computer and use it in GitHub Desktop.
Save AhmedCommando/834cf58e0495317dda8e152409d5d623 to your computer and use it in GitHub Desktop.
package.json scripts without testing
"scripts": {
"_comment_" : "clean our build folder and all logs",
"clean": "rimraf ./build/* && rimraf ./logs/*",
"_comment_" : "lint all source code",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"_comment_" : "build will clean, lint then will call webpack with watch enabled to check and transpile",
"build": "yarn clean && yarn lint && webpack --watch",
"_comment_" : "start the build in development mode",
"start:dev": "NODE_ENV=development yarn build",
"_comment_" : "will be called by webpack when build is done to run pm2 with our development config",
"run:dev": "pm2 start ./config/pm2/pm2-dev-process.config.js",
"_comment_" : "start the build in production mode",
"start:prod": "NODE_ENV=production yarn build",
"_comment_" : "will be called by webpack when build is done to run pm2 with our development config",
"run:prod": "pm2 start ./config/pm2/pm2-prod-process.config.js",
"_comment_" : "pm2 monitor feature, helps track your processes, logs, memory usage, ...",
"monitor": "pm2 monit",
"_comment_" : "will display the last 2000 lines of the logs",
"logs": "pm2 logs api-rest --lines 2000",
"_comment_" : "stop will delete pm2 processes and clean everything",
"stop": "pm2 delete api-rest && yarn clean"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment