Skip to content

Commit

Permalink
fixes #1081, closes #1079. addDevServerEndpoints needs app stub for
Browse files Browse the repository at this point in the history
createDomain
  • Loading branch information
shellscape committed Sep 13, 2017
1 parent e61972a commit e5dc236
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/util/addDevServerEntrypoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@

const createDomain = require('./createDomain');

module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptions) {
module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptions, listeningApp) {
if (devServerOptions.inline !== false) {
const domain = createDomain(devServerOptions);
// we're stubbing the app in this method as it's static and doesn't require
// a listeningApp to be supplied. createDomain requires an app with the
// address() signature.
const app = listeningApp || {
address() {
return { port: devServerOptions.port };
}
};
const domain = createDomain(devServerOptions, app);
const devClient = [`${require.resolve('../../client/')}?${domain}`];

if (devServerOptions.hotOnly) { devClient.push('webpack/hot/only-dev-server'); } else if (devServerOptions.hot) { devClient.push('webpack/hot/dev-server'); }
Expand Down

0 comments on commit e5dc236

Please sign in to comment.