Allow building only a single view

This commit is contained in:
Ray Schamp 2018-03-07 15:16:46 -05:00
parent 18ddbbfd18
commit d0e83afcb9
2 changed files with 3 additions and 1 deletions

View file

@ -6,7 +6,7 @@ var webpack = require('webpack');
var compiler = webpack(require('../webpack.config.js'));
var handler = require('./handler');
var log = require('./log');
var routes = require('../src/routes.json').concat(require('../src/routes-dev.json'));
var routes = require('../src/routes.json').concat(require('../src/routes-dev.json')).filter(route => !process.env.VIEW || process.env.VIEW === route.view);
// Create server
var app = express();

View file

@ -13,6 +13,8 @@ if (process.env.NODE_ENV !== 'production') {
routes = routes.concat(require('./src/routes-dev.json')); // eslint-disable-line global-require
}
routes = routes.filter(route => !process.env.VIEW || process.env.VIEW === route.view);
let VersionPlugin = function (options) {
this.options = options || {};
return this;