Commit bdcc03b6 authored by jcunanan05's avatar jcunanan05

Add Watch Script and Babel script with Readme

parent 29b5925d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Edit at https://www.gitignore.io/?templates=node,macos # Edit at https://www.gitignore.io/?templates=node,macos
## build folder ## build folder
dist dist-server
build build
### macOS ### ### macOS ###
......
# Express with ES6 # Express with ES6
An skeleton express app that allows you to use ES6 syntax. Generated by express-generator cli. 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 @@ ...@@ -21,10 +21,23 @@
"@babel/core": "^7.8.4", "@babel/core": "^7.8.4",
"@babel/preset-env": "^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": { "scripts": {
"start": "npm run prod", "start": "npm run prod",
"server": "node ./server/bin/www", "build": "npm-run-all clean transpile",
"dev": "NODE_ENV=development npm-run-all server", "server": "node ./dist-server/bin/www",
"prod": "NODE_ENV=production npm-run-all server" "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