webpack-dev-server 2.11.0 → 2.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +178 -178
- package/bin/webpack-dev-server.js +0 -0
- package/client/index.bundle.js +1 -1
- package/client/live.bundle.js +2 -2
- package/client/live.html +1 -1
- package/lib/OptionsValidationError.js +152 -152
- package/lib/Server.js +706 -706
- package/lib/optionsSchema.json +336 -336
- package/lib/polyfills.js +8 -8
- package/lib/util/addDevServerEntrypoints.js +34 -34
- package/lib/util/createDomain.js +23 -23
- package/package.json +2 -2
- package/ssl/.DS_Store +0 -0
package/lib/polyfills.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/* polyfills for Node 4.8.x users */
|
|
4
|
-
|
|
5
|
-
// internal-ip@2.x uses [].includes
|
|
6
|
-
const includes = require('array-includes');
|
|
7
|
-
|
|
8
|
-
includes.shim();
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* polyfills for Node 4.8.x users */
|
|
4
|
+
|
|
5
|
+
// internal-ip@2.x uses [].includes
|
|
6
|
+
const includes = require('array-includes');
|
|
7
|
+
|
|
8
|
+
includes.shim();
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/* eslint no-param-reassign: 'off' */
|
|
4
|
-
|
|
5
|
-
const createDomain = require('./createDomain');
|
|
6
|
-
|
|
7
|
-
module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptions, listeningApp) {
|
|
8
|
-
if (devServerOptions.inline !== false) {
|
|
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);
|
|
18
|
-
const devClient = [`${require.resolve('../../client/')}?${domain}`];
|
|
19
|
-
|
|
20
|
-
if (devServerOptions.hotOnly) { devClient.push('webpack/hot/only-dev-server'); } else if (devServerOptions.hot) { devClient.push('webpack/hot/dev-server'); }
|
|
21
|
-
|
|
22
|
-
[].concat(webpackOptions).forEach((wpOpt) => {
|
|
23
|
-
if (typeof wpOpt.entry === 'object' && !Array.isArray(wpOpt.entry)) {
|
|
24
|
-
Object.keys(wpOpt.entry).forEach((key) => {
|
|
25
|
-
wpOpt.entry[key] = devClient.concat(wpOpt.entry[key]);
|
|
26
|
-
});
|
|
27
|
-
} else if (typeof wpOpt.entry === 'function') {
|
|
28
|
-
wpOpt.entry = wpOpt.entry(devClient);
|
|
29
|
-
} else {
|
|
30
|
-
wpOpt.entry = devClient.concat(wpOpt.entry);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint no-param-reassign: 'off' */
|
|
4
|
+
|
|
5
|
+
const createDomain = require('./createDomain');
|
|
6
|
+
|
|
7
|
+
module.exports = function addDevServerEntrypoints(webpackOptions, devServerOptions, listeningApp) {
|
|
8
|
+
if (devServerOptions.inline !== false) {
|
|
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);
|
|
18
|
+
const devClient = [`${require.resolve('../../client/')}?${domain}`];
|
|
19
|
+
|
|
20
|
+
if (devServerOptions.hotOnly) { devClient.push('webpack/hot/only-dev-server'); } else if (devServerOptions.hot) { devClient.push('webpack/hot/dev-server'); }
|
|
21
|
+
|
|
22
|
+
[].concat(webpackOptions).forEach((wpOpt) => {
|
|
23
|
+
if (typeof wpOpt.entry === 'object' && !Array.isArray(wpOpt.entry)) {
|
|
24
|
+
Object.keys(wpOpt.entry).forEach((key) => {
|
|
25
|
+
wpOpt.entry[key] = devClient.concat(wpOpt.entry[key]);
|
|
26
|
+
});
|
|
27
|
+
} else if (typeof wpOpt.entry === 'function') {
|
|
28
|
+
wpOpt.entry = wpOpt.entry(devClient);
|
|
29
|
+
} else {
|
|
30
|
+
wpOpt.entry = devClient.concat(wpOpt.entry);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
package/lib/util/createDomain.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const url = require('url');
|
|
4
|
-
const internalIp = require('internal-ip');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
module.exports = function createDomain(options, listeningApp) {
|
|
8
|
-
const protocol = options.https ? 'https' : 'http';
|
|
9
|
-
const appPort = listeningApp ? listeningApp.address().port : 0;
|
|
10
|
-
const port = options.socket ? 0 : appPort;
|
|
11
|
-
const hostname = options.useLocalIp ? internalIp.v4() : options.host;
|
|
12
|
-
|
|
13
|
-
// use explicitly defined public url (prefix with protocol if not explicitly given)
|
|
14
|
-
if (options.public) {
|
|
15
|
-
return /^[a-zA-Z]+:\/\//.test(options.public) ? `${options.public}` : `${protocol}://${options.public}`;
|
|
16
|
-
}
|
|
17
|
-
// the formatted domain (url without path) of the webpack server
|
|
18
|
-
return url.format({
|
|
19
|
-
protocol,
|
|
20
|
-
hostname,
|
|
21
|
-
port
|
|
22
|
-
});
|
|
23
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const url = require('url');
|
|
4
|
+
const internalIp = require('internal-ip');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module.exports = function createDomain(options, listeningApp) {
|
|
8
|
+
const protocol = options.https ? 'https' : 'http';
|
|
9
|
+
const appPort = listeningApp ? listeningApp.address().port : 0;
|
|
10
|
+
const port = options.socket ? 0 : appPort;
|
|
11
|
+
const hostname = options.useLocalIp ? internalIp.v4() : options.host;
|
|
12
|
+
|
|
13
|
+
// use explicitly defined public url (prefix with protocol if not explicitly given)
|
|
14
|
+
if (options.public) {
|
|
15
|
+
return /^[a-zA-Z]+:\/\//.test(options.public) ? `${options.public}` : `${protocol}://${options.public}`;
|
|
16
|
+
}
|
|
17
|
+
// the formatted domain (url without path) of the webpack server
|
|
18
|
+
return url.format({
|
|
19
|
+
protocol,
|
|
20
|
+
hostname,
|
|
21
|
+
port
|
|
22
|
+
});
|
|
23
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-dev-server",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.1",
|
|
4
4
|
"description": "Serves a webpack app. Updates the browser on changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "webpack/webpack-dev-server",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"sockjs": "0.3.19",
|
|
66
66
|
"sockjs-client": "1.1.4",
|
|
67
67
|
"spdy": "^3.4.1",
|
|
68
|
-
"strip-ansi": "^
|
|
68
|
+
"strip-ansi": "^3.0.0",
|
|
69
69
|
"supports-color": "^5.1.0",
|
|
70
70
|
"webpack-dev-middleware": "1.12.2",
|
|
71
71
|
"yargs": "6.6.0"
|
package/ssl/.DS_Store
ADDED
|
Binary file
|