Skip to content

Commit

Permalink
Update code to transpile on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Oct 17, 2016
1 parent 82d908c commit db833cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
20 changes: 7 additions & 13 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
"test:integration": "npm test '<%= srcDir %>/**/*.router.test.js'",
"coverage": "npm test -- --coverage && opn coverage/lcov-report/index.html",
"dev": "nodemon -i '*.test.js' .",
"prod": "npm run build && nodemon -i '*.test.js' -r dotenv-safe/config dist",
"prod": "cross-env NODE_ENV=production nodemon -i '*.test.js' -r dotenv-safe/config .",
"lint": "eslint '<%= srcDir %>/**/*.js'",
"clean": "del 'dist/!(.git*|Procfile)**'",
"copy": "copy package.json dist && copy <%= srcDir %>/**/package.json dist/<%= srcDir %>",
"transpile": "babel <%= srcDir %> -d dist/<%= srcDir %> -s inline -i '<%= srcDir %>/**/*.test.js'",
"build": "npm run clean && npm run copy && npm run transpile",
"docs": "apidoc -i <%= srcDir %> -o docs && apidoc-markdown -p docs -o DOCS.md && opn docs/index.html"
},
"jest": {
Expand All @@ -25,16 +21,9 @@
"devDependencies": {
"apidoc": "^0.16.1",
"apidoc-markdown": "^0.2.0",
"babel-cli": "^6.14.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-jest": "^16.0.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-1": "^6.16.0",
"copy": "^0.3.0",
"del-cli": "^0.2.0",
"cross-env": "^3.1.3",
"dotenv-safe": "^2.3.1",
"eslint": "^3.3.1",
"eslint-config-standard": "^6.0.0",
Expand All @@ -50,6 +39,11 @@
"supertest-as-promised": "^4.0.0"
},
"dependencies": {
"babel-core": "^6.17.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-1": "^6.16.0",
"babel-runtime": "^6.11.6",
<%_ if (generateAuthApi && passwordSignup) { _%>
"bcrypt": "^0.8.6",
Expand Down
6 changes: 1 addition & 5 deletions generators/app/templates/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
var env = process.env.NODE_ENV || 'development'

if (env === 'development' || env === 'test') {
require('babel-core/register')
}
require('babel-core/register')

exports = module.exports = require('./app')
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "generator-rest",
"version": "0.7.0",
"description": "RESTful API generator using NodeJS, Express and MongoDB (Mongoose). Watch https://youtu.be/6x-ijyG-ack",
"description": "RESTful API generator using NodeJS, Express and MongoDB. Watch https://youtu.be/6x-ijyG-ack",
"homepage": "https://github.com/diegohaz/generator-rest",
"author": {
"name": "Diego Haz",
Expand Down Expand Up @@ -42,9 +42,6 @@
"yosay": "^1.0.0"
},
"devDependencies": {
"apidoc": "^0.16.1",
"apidoc-markdown": "^0.2.0",
"babel-cli": "^6.14.0",
"babel-core": "^6.17.0",
"babel-eslint": "^7.0.0",
"babel-jest": "^16.0.0",
Expand All @@ -57,9 +54,7 @@
"body-parser": "^1.15.1",
"bodymen": "^1.0.1",
"compression": "^1.6.2",
"copy": "^0.3.0",
"cors": "^2.7.1",
"del-cli": "^0.2.0",
"dotenv-safe": "^2.3.1",
"eslint": "^3.1.1",
"eslint-config-standard": "^6.0.0",
Expand Down Expand Up @@ -87,7 +82,6 @@
"morgan": "^1.7.0",
"nock": "^8.0.0",
"nodemon": "^1.10.2",
"opn-cli": "^3.1.0",
"passport": "^0.3.2",
"passport-http": "^0.3.0",
"passport-http-bearer": "^1.0.1",
Expand Down

0 comments on commit db833cb

Please sign in to comment.