Hide components route in production

This commit is contained in:
Ray Schamp 2016-05-11 18:44:54 -04:00
parent 448bb8aa3f
commit a0a30155af
3 changed files with 13 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');
var routes = require('../src/routes.json').concat(require('../src/routes-dev.json'));
// Create server
var app = express();

8
src/routes-dev.json Normal file
View file

@ -0,0 +1,8 @@
[
{
"name": "components",
"pattern": "^/components/?$",
"view": "components/components",
"title": "Components"
}
]

View file

@ -7,6 +7,10 @@ var webpack = require('webpack');
var routes = require('./src/routes.json');
if (process.env.NODE_ENV !== 'production') {
routes = routes.concat(require('./src/routes-dev.json'));
}
var VersionPlugin = function (options) {
this.options = options || {};
return this;