introduce es6 and babel to whole app

This commit is contained in:
Berkeley Martinez
2015-06-29 12:01:56 -07:00
parent 28395a5957
commit c33c6c9a8f
4 changed files with 11 additions and 8 deletions

View File

@ -1,3 +1,4 @@
require('babel/register');
var gulp = require('gulp'), var gulp = require('gulp'),
path = require('path'), path = require('path'),
@ -118,6 +119,7 @@ gulp.task('serve', function(cb) {
script: paths.server, script: paths.server,
ext: '.js', ext: '.js',
ignore: paths.serverIgnore, ignore: paths.serverIgnore,
exec: './node_modules/.bin/babel-node',
env: { env: {
'NODE_ENV': 'development', 'NODE_ENV': 'development',
'DEBUG': process.env.DEBUG || 'freecc:*' 'DEBUG': process.env.DEBUG || 'freecc:*'

View File

@ -10,7 +10,7 @@
"npm": "2.3.0" "npm": "2.3.0"
}, },
"scripts": { "scripts": {
"start": "node server/server.js", "start": "babel-node server/server.js",
"lint": "eslint --ext=.js,.jsx .", "lint": "eslint --ext=.js,.jsx .",
"test": "mocha", "test": "mocha",
"postinstall": "bower cache clean && bower install && gulp build" "postinstall": "bower cache clean && bower install && gulp build"

View File

@ -1,3 +1,4 @@
require('babel/register');
var pm2 = require('pm2'); var pm2 = require('pm2');
pm2.connect(function() { pm2.connect(function() {
pm2.start({ pm2.start({

View File

@ -1,13 +1,13 @@
// appFactory is an es6 module import debugFactory from 'debug';
var debug = require('debug')('freecc:servereact'); import app$ from '../common/app/app-stream.jsx';
var app$ = require('../common/app/app-stream.jsx').default; import { Cat } from 'thundercats';
var Cat = require('thundercats').Cat;
var routes = [ const debug = debugFactory('freecc:servereact');
const routes = [
'/jobs' '/jobs'
]; ];
module.exports = function(app) { export default function reactSubRouter(app) {
var router = app.Router(); var router = app.Router();
routes.forEach(function(route) { routes.forEach(function(route) {
@ -54,4 +54,4 @@ module.exports = function(app) {
next next
); );
} }
}; }