From 2337cc562bbb4fd30493bbfbc516c98a04d9288c Mon Sep 17 00:00:00 2001 From: Shriram Date: Mon, 14 Nov 2016 13:59:15 -0800 Subject: [PATCH] Minify app.js (#95) * minify app.js * lint errors on index.js --- gulpfile.js | 2 +- index.js | 10 +++++----- package.json | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index a6b2cf0aed..91026f5015 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -100,7 +100,7 @@ gulp.task('browserifyViews', () => { const bundler = browserify(props); const outputPath = pathToApp.split('/').splice(2).join('/'); - var stream = bundler.bundle(); + var stream = bundler.transform('uglifyify').bundle(); return stream .on('error', (err) => { console.error(err); diff --git a/index.js b/index.js index 8c638cb3c6..6a831c2884 100644 --- a/index.js +++ b/index.js @@ -41,17 +41,17 @@ function start() { // eslint-disable-line max-statements const enforcesSSL = require('express-enforces-ssl'); const app = express(); - + /* - * Compress(gzip) all the api responses and all the static files. + * Compress(gzip) all the api responses and all the static files. * Since this is called before the static pages and the API routes, this will * ensure that both the static pages and the API response are compressed. */ - + app.use(compress()); - + const httpServer = require('http').Server(app); - + const io = require('socket.io')(httpServer); const socketIOSetup = require('./realtime/setupSocketIO'); socketIOSetup.setupNamespace(io); diff --git a/package.json b/package.json index 96681487dc..23ab4a9190 100644 --- a/package.json +++ b/package.json @@ -124,6 +124,7 @@ "supertest": "^1.1.0", "swagger-tools": "^0.10.1", "throng": "^1.0.1", + "uglifyify": "^3.0.4", "underscore": "^1.8.3", "validator": "^4.0.2", "vinyl-source-stream": "^1.1.0",