From ec6c41eb524ed54c89715930aee8b274b751f7ac Mon Sep 17 00:00:00 2001 From: Michael Scott Hertzberg Date: Mon, 13 Mar 2017 11:35:18 -0600 Subject: [PATCH] extend devMiddlewareOptions with config.devServer fixes #650 --- dist/server/middleware.js | 8 ++++++-- src/server/middleware.js | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/server/middleware.js b/dist/server/middleware.js index 2101e2319c4a..8ab9fb4d5541 100644 --- a/dist/server/middleware.js +++ b/dist/server/middleware.js @@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true }); +var _extends2 = require('babel-runtime/helpers/extends'); + +var _extends3 = _interopRequireDefault(_extends2); + exports.default = function (configDir) { // Build the webpack configuration using the `getBaseConfig` // custom `.babelrc` file and `webpack.config.js` files @@ -17,11 +21,11 @@ exports.default = function (configDir) { } var compiler = (0, _webpack2.default)(config); - var devMiddlewareOptions = { + var devMiddlewareOptions = (0, _extends3.default)({ noInfo: true, publicPath: config.output.publicPath, watchOptions: config.watchOptions || {} - }; + }, config.devServer); var router = new _express.Router(); router.use((0, _webpackDevMiddleware2.default)(compiler, devMiddlewareOptions)); diff --git a/src/server/middleware.js b/src/server/middleware.js index bc9a90a9da38..7efc6634113c 100644 --- a/src/server/middleware.js +++ b/src/server/middleware.js @@ -25,6 +25,7 @@ export default function (configDir) { noInfo: true, publicPath: config.output.publicPath, watchOptions: config.watchOptions || {}, + ...config.devServer, }; const router = new Router();