mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 15:17:53 -05:00
Fixed linting errors and webpack config for redirect routes.
This commit is contained in:
parent
cbc58d2f11
commit
a6be92448b
3 changed files with 6 additions and 5 deletions
|
@ -20,7 +20,8 @@
|
|||
"formatMessage": true
|
||||
},
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
"jsx": true,
|
||||
"arrowFunctions": true
|
||||
},
|
||||
"plugins": [
|
||||
"react"
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue