Skip to content

Commit

Permalink
Merge pull request #723 from moimikey/extend-webpack-middleware
Browse files Browse the repository at this point in the history
extend devMiddlewareOptions with config.devServer
  • Loading branch information
ndelangen authored Apr 12, 2017
2 parents 8d0d9aa + 171b348 commit d0efb70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dist/server/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/server/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function (configDir) {
noInfo: true,
publicPath: config.output.publicPath,
watchOptions: config.watchOptions || {},
...config.devServer,
};

const router = new Router();
Expand Down

0 comments on commit d0efb70

Please sign in to comment.