mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -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
|
"formatMessage": true
|
||||||
},
|
},
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"jsx": true
|
"jsx": true,
|
||||||
|
"arrowFunctions": true
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"react"
|
"react"
|
||||||
|
|
|
@ -3,7 +3,6 @@ var defaults = require('lodash.defaults');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var mustache = require('mustache');
|
var mustache = require('mustache');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
|
||||||
var config = require('./config');
|
var config = require('./config');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,8 +11,8 @@ var config = require('./config');
|
||||||
function Handler (route) {
|
function Handler (route) {
|
||||||
// Handle redirects
|
// Handle redirects
|
||||||
if (route.redirect) {
|
if (route.redirect) {
|
||||||
return (req, res) => res.redirect(route.redirect);
|
return (req, res) => { res.redirect(route.redirect); };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Route definition
|
// Route definition
|
||||||
defaults(route, config);
|
defaults(route, config);
|
||||||
|
|
|
@ -9,7 +9,8 @@ var entry = {
|
||||||
init: './src/init.js'
|
init: './src/init.js'
|
||||||
};
|
};
|
||||||
routes.forEach(function (route) {
|
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
|
// Config
|
||||||
|
|
Loading…
Reference in a new issue