From a6be92448baa5147476270b76593da0eb4d7bd78 Mon Sep 17 00:00:00 2001 From: "Shane M. Clements" Date: Sat, 9 Apr 2016 10:39:55 -0600 Subject: [PATCH] Fixed linting errors and webpack config for redirect routes. --- .eslintrc | 3 ++- server/handler.js | 5 ++--- webpack.config.js | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.eslintrc b/.eslintrc index a554d53e3..842a0b83b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -20,7 +20,8 @@ "formatMessage": true }, "ecmaFeatures": { - "jsx": true + "jsx": true, + "arrowFunctions": true }, "plugins": [ "react" diff --git a/server/handler.js b/server/handler.js index cb79e71ef..1022b50e7 100644 --- a/server/handler.js +++ b/server/handler.js @@ -3,7 +3,6 @@ var defaults = require('lodash.defaults'); var fs = require('fs'); var mustache = require('mustache'); var path = require('path'); - var config = require('./config'); /** @@ -12,8 +11,8 @@ var config = require('./config'); function Handler (route) { // Handle redirects if (route.redirect) { - return (req, res) => res.redirect(route.redirect); - } + return (req, res) => { res.redirect(route.redirect); }; + } // Route definition defaults(route, config); diff --git a/webpack.config.js b/webpack.config.js index 78474b3e1..99fd4f4b1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,7 +9,8 @@ var entry = { init: './src/init.js' }; routes.forEach(function (route) { - entry[route.view] = './src/views/' + route.view + '/' + route.view + '.jsx'; + if (!route.redirect) + entry[route.view] = './src/views/' + route.view + '/' + route.view + '.jsx'; }); // Config