webpack-dev-server 4.0.0-rc.0 → 4.1.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/README.md +3 -0
- package/bin/cli-flags.js +340 -316
- package/bin/process-arguments.js +42 -42
- package/bin/webpack-dev-server.js +28 -28
- package/client/clients/SockJSClient.js +7 -9
- package/client/clients/{WebsocketClient.js → WebSocketClient.js} +9 -10
- package/client/index.js +58 -69
- package/client/modules/logger/index.js +62 -64
- package/client/modules/sockjs-client/index.js +128 -42
- package/client/modules/strip-ansi/index.js +15 -20
- package/client/overlay.js +59 -66
- package/client/socket.js +8 -8
- package/client/utils/createSocketURL.js +12 -15
- package/client/utils/getCurrentScriptSource.js +5 -7
- package/client/utils/log.js +5 -10
- package/client/utils/parseURL.js +6 -9
- package/client/utils/reloadApp.js +42 -32
- package/client/utils/sendMessage.js +3 -5
- package/lib/Server.js +1405 -506
- package/lib/options.json +34 -9
- package/lib/servers/BaseServer.js +2 -2
- package/lib/servers/SockJSServer.js +17 -20
- package/lib/servers/WebsocketServer.js +14 -16
- package/package.json +14 -13
- package/client/modules/logger/SyncBailHookFake.js +0 -10
- package/client/webpack.config.js +0 -59
- package/lib/utils/DevServerPlugin.js +0 -352
- package/lib/utils/getCompilerConfigArray.js +0 -8
- package/lib/utils/normalizeOptions.js +0 -442
package/lib/options.json
CHANGED
|
@@ -71,12 +71,14 @@
|
|
|
71
71
|
},
|
|
72
72
|
"ClientLogging": {
|
|
73
73
|
"enum": ["none", "error", "warn", "info", "log", "verbose"],
|
|
74
|
-
"decription": "Allows to set log level in the browser."
|
|
74
|
+
"decription": "Allows to set log level in the browser.",
|
|
75
|
+
"link": "https://webpack.js.org/configuration/dev-server/#logging"
|
|
75
76
|
},
|
|
76
77
|
"ClientOverlay": {
|
|
77
78
|
"anyOf": [
|
|
78
79
|
{
|
|
79
80
|
"description": "Enables a full-screen overlay in the browser when there are compiler errors or warnings.",
|
|
81
|
+
"link": "https://webpack.js.org/configuration/dev-server/#overlay",
|
|
80
82
|
"type": "boolean"
|
|
81
83
|
},
|
|
82
84
|
{
|
|
@@ -97,6 +99,7 @@
|
|
|
97
99
|
},
|
|
98
100
|
"ClientProgress": {
|
|
99
101
|
"description": "Prints compilation progress in percentage in the browser.",
|
|
102
|
+
"link": "https://webpack.js.org/configuration/dev-server/#progress",
|
|
100
103
|
"type": "boolean"
|
|
101
104
|
},
|
|
102
105
|
"ClientWebSocketTransport": {
|
|
@@ -108,7 +111,8 @@
|
|
|
108
111
|
"$ref": "#/definitions/ClientWebSocketTransportString"
|
|
109
112
|
}
|
|
110
113
|
],
|
|
111
|
-
"description": "Allows to set custom web socket transport to communicate with dev server."
|
|
114
|
+
"description": "Allows to set custom web socket transport to communicate with dev server.",
|
|
115
|
+
"link": "https://webpack.js.org/configuration/dev-server/#websockettransport"
|
|
112
116
|
},
|
|
113
117
|
"ClientWebSocketTransportEnum": {
|
|
114
118
|
"enum": ["sockjs", "ws"]
|
|
@@ -119,6 +123,7 @@
|
|
|
119
123
|
},
|
|
120
124
|
"ClientWebSocketURL": {
|
|
121
125
|
"description": "Allows to specify URL to web socket server (useful when you're proxying dev server and client script does not always know where to connect to).",
|
|
126
|
+
"link": "https://webpack.js.org/configuration/dev-server/#websocketurl",
|
|
122
127
|
"anyOf": [
|
|
123
128
|
{
|
|
124
129
|
"type": "string",
|
|
@@ -283,10 +288,17 @@
|
|
|
283
288
|
"link": "https://webpack.js.org/configuration/dev-server/#devserverhistoryapifallback"
|
|
284
289
|
},
|
|
285
290
|
"Host": {
|
|
286
|
-
"type": "string",
|
|
287
|
-
"minLength": 1,
|
|
288
291
|
"description": "Allows to specify a hostname to use.",
|
|
289
|
-
"link": "https://webpack.js.org/configuration/dev-server/#devserverhost"
|
|
292
|
+
"link": "https://webpack.js.org/configuration/dev-server/#devserverhost",
|
|
293
|
+
"anyOf": [
|
|
294
|
+
{
|
|
295
|
+
"enum": ["local-ip", "local-ipv4", "local-ipv6"]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"type": "string",
|
|
299
|
+
"minLength": 1
|
|
300
|
+
}
|
|
301
|
+
]
|
|
290
302
|
},
|
|
291
303
|
"Hot": {
|
|
292
304
|
"anyOf": [
|
|
@@ -319,6 +331,11 @@
|
|
|
319
331
|
"description": "Enables reload/refresh the page(s) when file changes are detected (enabled by default).",
|
|
320
332
|
"link": "https://webpack.js.org/configuration/dev-server/#devserverlivereload"
|
|
321
333
|
},
|
|
334
|
+
"MagicHTML": {
|
|
335
|
+
"type": "boolean",
|
|
336
|
+
"description": "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
|
|
337
|
+
"link": "https://webpack.js.org/configuration/dev-server/#devservermagichtml"
|
|
338
|
+
},
|
|
322
339
|
"OnAfterSetupMiddleware": {
|
|
323
340
|
"instanceof": "Function",
|
|
324
341
|
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.",
|
|
@@ -507,10 +524,12 @@
|
|
|
507
524
|
"directory": {
|
|
508
525
|
"type": "string",
|
|
509
526
|
"minLength": 1,
|
|
510
|
-
"description": "Directory for static contents."
|
|
527
|
+
"description": "Directory for static contents.",
|
|
528
|
+
"link": "https://webpack.js.org/configuration/dev-server/#directory"
|
|
511
529
|
},
|
|
512
530
|
"staticOptions": {
|
|
513
531
|
"type": "object",
|
|
532
|
+
"link": "https://webpack.js.org/configuration/dev-server/#staticoptions",
|
|
514
533
|
"additionalProperties": true
|
|
515
534
|
},
|
|
516
535
|
"publicPath": {
|
|
@@ -526,7 +545,8 @@
|
|
|
526
545
|
"type": "string"
|
|
527
546
|
}
|
|
528
547
|
],
|
|
529
|
-
"description": "The static files will be available in the browser under this public path."
|
|
548
|
+
"description": "The static files will be available in the browser under this public path.",
|
|
549
|
+
"link": "https://webpack.js.org/configuration/dev-server/#publicpath"
|
|
530
550
|
},
|
|
531
551
|
"serveIndex": {
|
|
532
552
|
"anyOf": [
|
|
@@ -538,7 +558,8 @@
|
|
|
538
558
|
"additionalProperties": true
|
|
539
559
|
}
|
|
540
560
|
],
|
|
541
|
-
"description": "Tells dev server to use serveIndex middleware when enabled."
|
|
561
|
+
"description": "Tells dev server to use serveIndex middleware when enabled.",
|
|
562
|
+
"link": "https://webpack.js.org/configuration/dev-server/#serveindex"
|
|
542
563
|
},
|
|
543
564
|
"watch": {
|
|
544
565
|
"anyOf": [
|
|
@@ -551,7 +572,8 @@
|
|
|
551
572
|
"link": "https://github.com/paulmillr/chokidar#api"
|
|
552
573
|
}
|
|
553
574
|
],
|
|
554
|
-
"description": "Watches for files in static content directory."
|
|
575
|
+
"description": "Watches for files in static content directory.",
|
|
576
|
+
"link": "https://webpack.js.org/configuration/dev-server/#watch"
|
|
555
577
|
}
|
|
556
578
|
}
|
|
557
579
|
},
|
|
@@ -712,6 +734,9 @@
|
|
|
712
734
|
"liveReload": {
|
|
713
735
|
"$ref": "#/definitions/LiveReload"
|
|
714
736
|
},
|
|
737
|
+
"magicHtml": {
|
|
738
|
+
"$ref": "#/definitions/MagicHTML"
|
|
739
|
+
},
|
|
715
740
|
"onAfterSetupMiddleware": {
|
|
716
741
|
"$ref": "#/definitions/OnAfterSetupMiddleware"
|
|
717
742
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
// base class that users should extend if they are making their own
|
|
4
4
|
// server implementation
|
|
5
5
|
module.exports = class BaseServer {
|
|
6
6
|
constructor(server) {
|
|
7
7
|
this.server = server;
|
|
8
|
-
this.clients =
|
|
8
|
+
this.clients = [];
|
|
9
9
|
}
|
|
10
10
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable
|
|
4
4
|
class-methods-use-this
|
|
5
5
|
*/
|
|
6
|
-
const sockjs = require(
|
|
7
|
-
const BaseServer = require(
|
|
6
|
+
const sockjs = require("sockjs");
|
|
7
|
+
const BaseServer = require("./BaseServer");
|
|
8
8
|
|
|
9
9
|
// Workaround for sockjs@~0.3.19
|
|
10
10
|
// sockjs will remove Origin header, however Origin header is required for checking host.
|
|
11
11
|
// See https://github.com/webpack/webpack-dev-server/issues/1604 for more information
|
|
12
12
|
{
|
|
13
|
-
const SockjsSession = require(
|
|
13
|
+
const SockjsSession = require("sockjs/lib/transport").Session;
|
|
14
14
|
const decorateConnection = SockjsSession.prototype.decorateConnection;
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line func-names
|
|
@@ -21,8 +21,8 @@ const BaseServer = require('./BaseServer');
|
|
|
21
21
|
|
|
22
22
|
if (
|
|
23
23
|
connection.headers &&
|
|
24
|
-
!(
|
|
25
|
-
|
|
24
|
+
!("origin" in connection.headers) &&
|
|
25
|
+
"origin" in req.headers
|
|
26
26
|
) {
|
|
27
27
|
connection.headers.origin = req.headers.origin;
|
|
28
28
|
}
|
|
@@ -36,12 +36,12 @@ module.exports = class SockJSServer extends BaseServer {
|
|
|
36
36
|
|
|
37
37
|
this.implementation = sockjs.createServer({
|
|
38
38
|
// Use provided up-to-date sockjs-client
|
|
39
|
-
sockjs_url:
|
|
39
|
+
sockjs_url: "/__webpack_dev_server__/sockjs.bundle.js",
|
|
40
40
|
// Default logger is very annoy. Limit useless logs.
|
|
41
41
|
log: (severity, line) => {
|
|
42
|
-
if (severity ===
|
|
42
|
+
if (severity === "error") {
|
|
43
43
|
this.server.logger.error(line);
|
|
44
|
-
} else if (severity ===
|
|
44
|
+
} else if (severity === "info") {
|
|
45
45
|
this.server.logger.log(line);
|
|
46
46
|
} else {
|
|
47
47
|
this.server.logger.debug(line);
|
|
@@ -50,7 +50,7 @@ module.exports = class SockJSServer extends BaseServer {
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const getPrefix = (options) => {
|
|
53
|
-
if (typeof options.prefix !==
|
|
53
|
+
if (typeof options.prefix !== "undefined") {
|
|
54
54
|
return options.prefix;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -62,23 +62,20 @@ module.exports = class SockJSServer extends BaseServer {
|
|
|
62
62
|
prefix: getPrefix(this.server.options.webSocketServer.options),
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
this.implementation.on(
|
|
65
|
+
this.implementation.on("connection", (client) => {
|
|
66
66
|
// Implement the the same API as for `ws`
|
|
67
67
|
client.send = client.write;
|
|
68
|
+
client.terminate = client.close;
|
|
68
69
|
|
|
69
|
-
this.clients.
|
|
70
|
+
this.clients.push(client);
|
|
70
71
|
|
|
71
|
-
client.on(
|
|
72
|
-
this.clients.
|
|
72
|
+
client.on("close", () => {
|
|
73
|
+
this.clients.splice(this.clients.indexOf(client), 1);
|
|
73
74
|
});
|
|
74
75
|
});
|
|
75
76
|
|
|
76
|
-
this.implementation.close = () => {
|
|
77
|
-
|
|
78
|
-
client.close();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
this.clients.clear();
|
|
77
|
+
this.implementation.close = (callback) => {
|
|
78
|
+
callback();
|
|
82
79
|
};
|
|
83
80
|
}
|
|
84
81
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable
|
|
4
4
|
class-methods-use-this
|
|
5
5
|
*/
|
|
6
|
-
const WebSocket = require(
|
|
7
|
-
const BaseServer = require(
|
|
6
|
+
const WebSocket = require("ws");
|
|
7
|
+
const BaseServer = require("./BaseServer");
|
|
8
8
|
|
|
9
9
|
module.exports = class WebsocketServer extends BaseServer {
|
|
10
10
|
static heartbeatInterval = 1000;
|
|
@@ -17,8 +17,8 @@ module.exports = class WebsocketServer extends BaseServer {
|
|
|
17
17
|
clientTracking: false,
|
|
18
18
|
};
|
|
19
19
|
const isNoServerMode =
|
|
20
|
-
typeof options.port ===
|
|
21
|
-
typeof options.server ===
|
|
20
|
+
typeof options.port === "undefined" &&
|
|
21
|
+
typeof options.server === "undefined";
|
|
22
22
|
|
|
23
23
|
if (isNoServerMode) {
|
|
24
24
|
options.noServer = true;
|
|
@@ -26,17 +26,17 @@ module.exports = class WebsocketServer extends BaseServer {
|
|
|
26
26
|
|
|
27
27
|
this.implementation = new WebSocket.Server(options);
|
|
28
28
|
|
|
29
|
-
this.server.server.on(
|
|
29
|
+
this.server.server.on("upgrade", (req, sock, head) => {
|
|
30
30
|
if (!this.implementation.shouldHandle(req)) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
this.implementation.handleUpgrade(req, sock, head, (connection) => {
|
|
35
|
-
this.implementation.emit(
|
|
35
|
+
this.implementation.emit("connection", connection, req);
|
|
36
36
|
});
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
this.implementation.on(
|
|
39
|
+
this.implementation.on("error", (err) => {
|
|
40
40
|
this.server.logger.error(err.message);
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -53,24 +53,22 @@ module.exports = class WebsocketServer extends BaseServer {
|
|
|
53
53
|
});
|
|
54
54
|
}, WebsocketServer.heartbeatInterval);
|
|
55
55
|
|
|
56
|
-
this.implementation.on(
|
|
57
|
-
this.clients.
|
|
56
|
+
this.implementation.on("connection", (client) => {
|
|
57
|
+
this.clients.push(client);
|
|
58
58
|
|
|
59
59
|
client.isAlive = true;
|
|
60
60
|
|
|
61
|
-
client.on(
|
|
61
|
+
client.on("pong", () => {
|
|
62
62
|
client.isAlive = true;
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
client.on(
|
|
66
|
-
this.clients.
|
|
65
|
+
client.on("close", () => {
|
|
66
|
+
this.clients.splice(this.clients.indexOf(client), 1);
|
|
67
67
|
});
|
|
68
68
|
});
|
|
69
69
|
|
|
70
|
-
this.implementation.on(
|
|
70
|
+
this.implementation.on("close", () => {
|
|
71
71
|
clearInterval(interval);
|
|
72
|
-
|
|
73
|
-
this.clients.clear();
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-dev-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.1",
|
|
4
4
|
"description": "Serves a webpack app. Updates the browser on changes.",
|
|
5
5
|
"bin": "bin/webpack-dev-server.js",
|
|
6
6
|
"main": "lib/Server.js",
|
|
@@ -21,19 +21,21 @@
|
|
|
21
21
|
"fix:js": "npm run lint:js -- --fix",
|
|
22
22
|
"fix": "npm-run-all fix:js fmt",
|
|
23
23
|
"commitlint": "commitlint --from=master",
|
|
24
|
+
"build": "npm-run-all build:client",
|
|
25
|
+
"build:client": "rimraf ./client/* && babel client-src/ --out-dir client/ --ignore \"client-src/webpack.config.js\" --ignore \"client-src/modules\" && webpack --config client-src/webpack.config.js",
|
|
24
26
|
"test:only": "jest",
|
|
25
27
|
"test:coverage": "npm run test:only -- --coverage",
|
|
26
28
|
"test:watch": "npm run test:coverage --watch",
|
|
27
29
|
"test": "npm run test:coverage",
|
|
28
30
|
"pretest": "npm run lint",
|
|
29
|
-
"prepare": "npm run build
|
|
30
|
-
"build:client": "rimraf ./client/* && babel client-src/ --out-dir client/ --ignore \"webpack.config.js\" && webpack --config client/webpack.config.js",
|
|
31
|
+
"prepare": "husky install && npm run build",
|
|
31
32
|
"release": "standard-version"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"ansi-html": "^0.0.
|
|
35
|
+
"ansi-html-community": "^0.0.8",
|
|
35
36
|
"bonjour": "^3.5.0",
|
|
36
37
|
"chokidar": "^3.5.1",
|
|
38
|
+
"colorette": "^1.2.2",
|
|
37
39
|
"compression": "^1.7.4",
|
|
38
40
|
"connect-history-api-fallback": "^1.6.0",
|
|
39
41
|
"del": "^6.0.0",
|
|
@@ -43,8 +45,6 @@
|
|
|
43
45
|
"http-proxy-middleware": "^2.0.0",
|
|
44
46
|
"internal-ip": "^6.2.0",
|
|
45
47
|
"ipaddr.js": "^2.0.1",
|
|
46
|
-
"is-absolute-url": "^3.0.3",
|
|
47
|
-
"killable": "^1.0.1",
|
|
48
48
|
"open": "^8.0.9",
|
|
49
49
|
"p-retry": "^4.5.0",
|
|
50
50
|
"portfinder": "^1.0.28",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"strip-ansi": "^7.0.0",
|
|
57
57
|
"url": "^0.11.0",
|
|
58
58
|
"webpack-dev-middleware": "^5.0.0",
|
|
59
|
-
"ws": "^
|
|
59
|
+
"ws": "^8.1.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@babel/cli": "^7.14.5",
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
|
67
67
|
"@babel/preset-env": "^7.14.5",
|
|
68
68
|
"@babel/runtime": "^7.14.5",
|
|
69
|
-
"@commitlint/cli": "^
|
|
70
|
-
"@commitlint/config-conventional": "^
|
|
69
|
+
"@commitlint/cli": "^13.1.0",
|
|
70
|
+
"@commitlint/config-conventional": "^13.1.0",
|
|
71
71
|
"acorn": "^8.2.4",
|
|
72
72
|
"babel-jest": "^27.0.2",
|
|
73
73
|
"babel-loader": "^8.2.2",
|
|
@@ -84,10 +84,11 @@
|
|
|
84
84
|
"http-proxy": "^1.18.1",
|
|
85
85
|
"husky": "^7.0.0",
|
|
86
86
|
"jest": "^27.0.4",
|
|
87
|
+
"klona": "^2.0.4",
|
|
87
88
|
"less": "^4.1.1",
|
|
88
89
|
"less-loader": "^7.3.0",
|
|
89
90
|
"lint-staged": "^11.0.0",
|
|
90
|
-
"marked": "^
|
|
91
|
+
"marked": "^3.0.0",
|
|
91
92
|
"memfs": "^3.2.2",
|
|
92
93
|
"npm-run-all": "^4.1.5",
|
|
93
94
|
"prettier": "^2.3.1",
|
|
@@ -96,18 +97,18 @@
|
|
|
96
97
|
"rimraf": "^3.0.2",
|
|
97
98
|
"sockjs-client": "^1.5.1",
|
|
98
99
|
"standard-version": "^9.3.0",
|
|
99
|
-
"style-loader": "^2.0.0",
|
|
100
100
|
"strip-ansi-v6": "npm:strip-ansi@^6.0.0",
|
|
101
|
+
"style-loader": "^2.0.0",
|
|
101
102
|
"supertest": "^6.1.3",
|
|
102
103
|
"tcp-port-used": "^1.0.2",
|
|
103
104
|
"typescript": "^4.2.4",
|
|
104
105
|
"url-loader": "^4.1.1",
|
|
105
|
-
"webpack": "^5.
|
|
106
|
+
"webpack": "^5.50.0",
|
|
106
107
|
"webpack-cli": "^4.7.2",
|
|
107
108
|
"webpack-merge": "^5.8.0"
|
|
108
109
|
},
|
|
109
110
|
"peerDependencies": {
|
|
110
|
-
"webpack": "^4.
|
|
111
|
+
"webpack": "^4.37.0 || ^5.0.0"
|
|
111
112
|
},
|
|
112
113
|
"peerDependenciesMeta": {
|
|
113
114
|
"webpack-cli": {
|
package/client/webpack.config.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var path = require('path');
|
|
4
|
-
|
|
5
|
-
var webpack = require('webpack');
|
|
6
|
-
|
|
7
|
-
var _require = require('webpack-merge'),
|
|
8
|
-
merge = _require.merge;
|
|
9
|
-
|
|
10
|
-
var baseForModules = {
|
|
11
|
-
devtool: false,
|
|
12
|
-
mode: 'development',
|
|
13
|
-
output: {
|
|
14
|
-
path: path.resolve(__dirname, '../client/modules'),
|
|
15
|
-
libraryTarget: 'commonjs2'
|
|
16
|
-
},
|
|
17
|
-
target: webpack.webpack ? ['web', 'es5'] : 'web',
|
|
18
|
-
module: {
|
|
19
|
-
rules: [{
|
|
20
|
-
test: /\.js$/,
|
|
21
|
-
use: [{
|
|
22
|
-
loader: 'babel-loader'
|
|
23
|
-
}]
|
|
24
|
-
}]
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
module.exports = [merge(baseForModules, {
|
|
28
|
-
entry: path.join(__dirname, 'modules/logger/index.js'),
|
|
29
|
-
output: {
|
|
30
|
-
filename: 'logger/index.js'
|
|
31
|
-
},
|
|
32
|
-
module: {
|
|
33
|
-
rules: [{
|
|
34
|
-
test: /\.js$/,
|
|
35
|
-
use: [{
|
|
36
|
-
loader: 'babel-loader',
|
|
37
|
-
options: {
|
|
38
|
-
plugins: ['@babel/plugin-transform-object-assign']
|
|
39
|
-
}
|
|
40
|
-
}]
|
|
41
|
-
}]
|
|
42
|
-
},
|
|
43
|
-
plugins: [new webpack.DefinePlugin({
|
|
44
|
-
Symbol: '(typeof Symbol !== "undefined" ? Symbol : function (i) { return i; })'
|
|
45
|
-
}), new webpack.NormalModuleReplacementPlugin(/^tapable\/lib\/SyncBailHook/, path.join(__dirname, 'modules/logger/SyncBailHookFake.js'))]
|
|
46
|
-
}), merge(baseForModules, {
|
|
47
|
-
entry: path.join(__dirname, 'modules/strip-ansi/index.js'),
|
|
48
|
-
output: {
|
|
49
|
-
filename: 'strip-ansi/index.js'
|
|
50
|
-
}
|
|
51
|
-
}), merge(baseForModules, {
|
|
52
|
-
entry: path.join(__dirname, 'modules/sockjs-client/index.js'),
|
|
53
|
-
output: {
|
|
54
|
-
filename: 'sockjs-client/index.js',
|
|
55
|
-
library: 'SockJS',
|
|
56
|
-
libraryTarget: 'umd',
|
|
57
|
-
globalObject: "(typeof self !== 'undefined' ? self : this)"
|
|
58
|
-
}
|
|
59
|
-
})];
|