Skip to content

Commit e5dc236

Browse files
committed
fixes #1081, closes #1079. addDevServerEndpoints needs app stub for
createDomain
1 parent e61972a commit e5dc236

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/util/addDevServerEntrypoints.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@
44

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

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

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

0 commit comments

Comments
 (0)