Commit bdcc03b6 authored by jcunanan05's avatar jcunanan05

Add Watch Script and Babel script with Readme

parent 29b5925d
......@@ -2,7 +2,7 @@
# Edit at https://www.gitignore.io/?templates=node,macos
## build folder
dist
dist-server
build
### macOS ###
......
# Express with ES6
An skeleton express app that allows you to use ES6 syntax. Generated by express-generator cli.
## How to run
Before anything else, you must have node installed on your machine.
### Running Dev Server
Run on your terminal `npm run watch:dev`, the server will restart everytime you make a change in your code.
### Running Production Server
For stuff like heroku deployment, aws elasticbeanstalk, run `npm run start`
### Other scripts
* `transpile` - convert es6 and beyond code to es5 to a folder named `dist-server`
* `clean` - delete transpiled folder
* `build` - clean and transpile
......@@ -21,10 +21,23 @@
"@babel/core": "^7.8.4",
"@babel/preset-env": "^7.8.4"
},
"nodemonConfig": {
"exec": "npm run dev",
"watch": ["server/*", "public/*"],
"ignore": ["**/__tests__/**", "*.test.js", "*.spec.js"]
},
"babel": {
"presets": ["@babel/preset-env"],
"ignore": ["**/__tests__/**", "*.test.js", "*.spec.js"]
},
"scripts": {
"start": "npm run prod",
"server": "node ./server/bin/www",
"dev": "NODE_ENV=development npm-run-all server",
"prod": "NODE_ENV=production npm-run-all server"
"build": "npm-run-all clean transpile",
"server": "node ./dist-server/bin/www",
"dev": "NODE_ENV=development npm-run-all build server",
"prod": "NODE_ENV=production npm-run-all build server",
"transpile": "babel ./server --out-dir dist-server",
"clean": "rimraf dist-server",
"watch:dev": "nodemon"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment