Skip to content

Commit 696346d

Browse files
committed
production-ready devServer
1 parent fa55000 commit 696346d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

devServer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ const path = require('path')
22
const express = require('express')
33
const http = require('http')
44
const webpack = require('webpack')
5-
const config = require('./webpack.config.dev')
5+
const config = (
6+
process.env['NODE_ENV'] === 'development'
7+
? require('./webpack.config.dev')
8+
: require('./webpack.config.prod')
9+
)
10+
611

712
const dispatcher = require('redux-scuttlebutt/lib/server').default
813
const getFilterHistory = require('./src/store/getFilterHistory.es5')

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"build:webpack": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js",
88
"build": "npm run clean && npm run build:webpack",
99
"start": "node devServer.js",
10+
"start-history": "OUTFILE=history-`date +20\\%y\\%m\\%d_\\%H\\%M\\%S`.log npm start",
1011
"lint": "standard"
1112
},
1213
"repository": {

0 commit comments

Comments
 (0)