webpack-dev-server 4.0.0 → 4.2.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 CHANGED
@@ -73,73 +73,78 @@ Options:
73
73
  --node-env <value> Sets process.env.NODE_ENV to the specified value.
74
74
  --progress [value] Print compilation progress during build.
75
75
  -j, --json [value] Prints result as JSON or store it in a file.
76
+ --entry <value...> The entry point(s) of your application e.g. ./src/main.js.
77
+ -o, --output-path <value> Output location of the file generated by webpack e.g. ./dist/.
78
+ -t, --target <value> Sets the build target e.g. node.
76
79
  -d, --devtool <value> Determine source maps to use.
77
80
  --no-devtool Do not generate source maps.
78
- --entry <value...> The entry point(s) of your application e.g. ./src/main.js.
79
81
  --mode <value> Defines the mode to pass to webpack.
80
82
  --name <value> Name of the configuration. Used when loading multiple configurations.
81
- -o, --output-path <value> Output location of the file generated by webpack e.g. ./dist/.
82
83
  --stats [value] It instructs webpack on how to treat the stats e.g. verbose.
83
84
  --no-stats Disable stats output.
84
- -t, --target <value...> Sets the build target e.g. node.
85
- --no-target Negative 'target' option.
86
85
  --watch-options-stdin Stop watching when stdin stream has ended.
87
86
  --no-watch-options-stdin Do not stop watching when stdin stream has ended.
88
- --allowed-hosts <value...> Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying
89
- dev server, by default is 'auto').
90
- --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to
91
- the dev server are allowed (useful when you are proxying dev server, by default is 'auto').
87
+ --allowed-hosts <value...> Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').
88
+ --allowed-hosts-reset Clear all items provided in 'allowedHosts' configuration. Allows to enumerate the hosts from which access to the dev server are allowed (useful when you are proxying dev server, by default is 'auto').
92
89
  --bonjour Allows to broadcasts dev server via ZeroConf networking on start.
93
- --no-bonjour Negative 'bonjour' option.
90
+ --no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start.
91
+ --client-web-socket-transport <value> Allows to set custom web socket transport to communicate with dev server.
94
92
  --no-client Negative 'client' option.
95
93
  --client-logging <value> Allows to specify options for client script in the browser or disable client script.
94
+ --client-progress Prints compilation progress in percentage in the browser.
95
+ --no-client-progress Does not print compilation progress in percentage in the browser.
96
96
  --client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings.
97
- --no-client-overlay Negative 'client-overlay' option.
97
+ --no-client-overlay Disables a full-screen overlay in the browser when there are compiler errors or warnings.
98
98
  --client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors.
99
99
  --no-client-overlay-errors Negative 'client-overlay-errors' option.
100
100
  --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings.
101
101
  --no-client-overlay-warnings Negative 'client-overlay-warnings' option.
102
- --client-progress Prints compilation progress in percentage in the browser.
103
- --no-client-progress Negative 'client-progress' option.
104
- --client-web-socket-transport <value> Allows to set custom web socket transport to communicate with dev server.
105
- --client-web-socket-url <value> Allows to specify URL to web socket server (useful when you're proxying dev server and client script does
106
- not always know where to connect to).
102
+ --client-web-socket-url <value> 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).
107
103
  --client-web-socket-url-hostname <value> Tells clients connected to devServer to use the provided hostname.
108
- --client-web-socket-url-pathname <value> Tells clients connected to devServer to use the provided path to connect.
109
- --client-web-socket-url-password <value> Tells clients connected to devServer to use the provided password to authenticate.
110
104
  --client-web-socket-url-port <value> Tells clients connected to devServer to use the provided port.
105
+ --client-web-socket-url-pathname <value> Tells clients connected to devServer to use the provided path to connect.
111
106
  --client-web-socket-url-protocol <value> Tells clients connected to devServer to use the provided protocol.
112
107
  --client-web-socket-url-username <value> Tells clients connected to devServer to use the provided username to authenticate.
108
+ --client-web-socket-url-password <value> Tells clients connected to devServer to use the provided password to authenticate.
109
+ --web-socket-server <value> Allows to set web socket server and options (by default 'ws').
110
+ --no-web-socket-server Negative 'web-socket-server' option.
113
111
  --compress Enables gzip compression for everything served.
114
- --no-compress Negative 'compress' option.
115
- --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page
116
- Applications that utilise the HTML5 History API.
112
+ --no-compress Disables gzip compression for everything served.
113
+ --history-api-fallback Allows to proxy requests through a specified index page (by default 'index.html'), useful for Single Page Applications that utilise the HTML5 History API.
117
114
  --no-history-api-fallback Negative 'history-api-fallback' option.
118
115
  --host <value> Allows to specify a hostname to use.
119
116
  --hot [value] Enables Hot Module Replacement.
120
- --no-hot Negative 'hot' option.
117
+ --no-hot Disables Hot Module Replacement.
121
118
  --http2 Allows to serve over HTTP/2 using SPDY.
122
- --no-http2 Negative 'http2' option.
119
+ --no-http2 Does not serve over HTTP/2 using SPDY.
123
120
  --https Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).
124
- --no-https Negative 'https' option.
121
+ --no-https Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).
125
122
  --https-passphrase <value> Passphrase for a pfx file.
126
123
  --https-request-cert Request for an SSL certificate.
127
- --no-https-request-cert Negative 'https-request-cert' option.
128
- --https-cacert <value> Path to an SSL CA certificate.
129
- --https-key <value> Path to an SSL key.
130
- --https-pfx <value> Path to an SSL pfx file.
131
- --https-cert <value> Path to an SSL certificate.
124
+ --no-https-request-cert Does not request for an SSL certificate.
125
+ --https-ca <value...> Path to an SSL CA certificate or content of an SSL CA certificate.
126
+ --https-ca-reset Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.
127
+ --https-cacert <value...> Path to an SSL CA certificate or content of an SSL CA certificate.
128
+ --https-cacert-reset Clear all items provided in 'https.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.
129
+ --https-key <value...> Path to an SSL key or content of an SSL key.
130
+ --https-key-reset Clear all items provided in 'https.key' configuration. Path to an SSL key or content of an SSL key.
131
+ --https-pfx <value...> Path to an SSL pfx file or content of an SSL pfx file.
132
+ --https-pfx-reset Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.
133
+ --https-cert <value...> Path to an SSL certificate or content of an SSL certificate.
134
+ --https-cert-reset Clear all items provided in 'https.cert' configuration. Path to an SSL certificate or content of an SSL certificate.
135
+ --https-crl <value...> Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).
136
+ --https-crl-reset Clear all items provided in 'https.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).
132
137
  --ipc [value] Listen to a unix socket.
133
138
  --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default).
134
- --no-live-reload Negative 'live-reload' option.
135
- --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to
136
- true to open your default browser).
137
- --no-open Negative 'open' option.
139
+ --no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default)
140
+ --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
141
+ --no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
142
+ --open [value...] Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).
143
+ --no-open Does not open the default browser.
138
144
  --open-target <value...> Opens specified page in browser.
139
145
  --open-app-name <value...> Open specified browser.
140
146
  --open-app <value...> Open specified browser.
141
- --open-reset Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and
142
- page(s) after server had been started (set it to true to open your default browser).
147
+ --open-reset Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).
143
148
  --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser.
144
149
  --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser.
145
150
  --port <value> Allows to specify a port to use.
@@ -148,18 +153,13 @@ Options:
148
153
  --static-directory <value...> Directory for static contents.
149
154
  --static-public-path <value...> The static files will be available in the browser under this public path.
150
155
  --static-serve-index Tells dev server to use serveIndex middleware when enabled.
151
- --no-static-serve-index Negative 'static-serve-index' option.
156
+ --no-static-serve-index Does not tell dev server to use serveIndex middleware.
152
157
  --static-watch Watches for files in static content directory.
153
- --no-static-watch Negative 'static-watch' option.
154
- --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files
155
- from directory (by default 'public' directory).
156
- --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the
157
- browser under this public path.
158
+ --no-static-watch Does not watch for files in static content directory.
159
+ --static-reset Clear all items provided in 'static' configuration. Allows to configure options for serving static files from directory (by default 'public' directory).
160
+ --static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.
158
161
  --watch-files <value...> Allows to configure list of globs/directories/files to watch for file changes.
159
- --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files
160
- to watch for file changes.
161
- --web-socket-server <value> Allows to set web socket server and options (by default 'ws').
162
- --no-web-socket-server Negative 'web-socket-server' option.
162
+ --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.
163
163
 
164
164
  Global options:
165
165
  --color Enable colors on console.
package/bin/cli-flags.js CHANGED
@@ -445,57 +445,180 @@ module.exports = {
445
445
  simpleType: "boolean",
446
446
  multiple: false,
447
447
  },
448
+ "https-ca": {
449
+ configs: [
450
+ {
451
+ type: "string",
452
+ multiple: true,
453
+ description:
454
+ "Path to an SSL CA certificate or content of an SSL CA certificate.",
455
+ path: "https.ca[]",
456
+ },
457
+ ],
458
+ description:
459
+ "Path to an SSL CA certificate or content of an SSL CA certificate.",
460
+ simpleType: "string",
461
+ multiple: true,
462
+ },
463
+ "https-ca-reset": {
464
+ configs: [
465
+ {
466
+ description:
467
+ "Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.",
468
+ multiple: false,
469
+ path: "https.ca",
470
+ type: "reset",
471
+ },
472
+ ],
473
+ description:
474
+ "Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.",
475
+ multiple: false,
476
+ simpleType: "boolean",
477
+ },
448
478
  "https-cacert": {
449
479
  configs: [
450
480
  {
451
481
  type: "string",
482
+ multiple: true,
483
+ description:
484
+ "Path to an SSL CA certificate or content of an SSL CA certificate.",
485
+ path: "https.cacert[]",
486
+ },
487
+ ],
488
+ description:
489
+ "Path to an SSL CA certificate or content of an SSL CA certificate.",
490
+ simpleType: "string",
491
+ multiple: true,
492
+ },
493
+ "https-cacert-reset": {
494
+ configs: [
495
+ {
496
+ description:
497
+ "Clear all items provided in 'https.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.",
452
498
  multiple: false,
453
- description: "Path to an SSL CA certificate.",
454
499
  path: "https.cacert",
500
+ type: "reset",
455
501
  },
456
502
  ],
457
- description: "Path to an SSL CA certificate.",
458
- simpleType: "string",
503
+ description:
504
+ "Clear all items provided in 'https.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.",
459
505
  multiple: false,
506
+ simpleType: "boolean",
460
507
  },
461
508
  "https-key": {
462
509
  configs: [
463
510
  {
464
511
  type: "string",
512
+ multiple: true,
513
+ description: "Path to an SSL key or content of an SSL key.",
514
+ path: "https.key[]",
515
+ },
516
+ ],
517
+ description: "Path to an SSL key or content of an SSL key.",
518
+ simpleType: "string",
519
+ multiple: true,
520
+ },
521
+ "https-key-reset": {
522
+ configs: [
523
+ {
524
+ description:
525
+ "Clear all items provided in 'https.key' configuration. Path to an SSL key or content of an SSL key.",
465
526
  multiple: false,
466
- description: "Path to an SSL key.",
467
527
  path: "https.key",
528
+ type: "reset",
468
529
  },
469
530
  ],
470
- description: "Path to an SSL key.",
471
- simpleType: "string",
531
+ description:
532
+ "Clear all items provided in 'https.key' configuration. Path to an SSL key or content of an SSL key.",
472
533
  multiple: false,
534
+ simpleType: "boolean",
473
535
  },
474
536
  "https-pfx": {
475
537
  configs: [
476
538
  {
477
539
  type: "string",
540
+ multiple: true,
541
+ description: "Path to an SSL pfx file or content of an SSL pfx file.",
542
+ path: "https.pfx[]",
543
+ },
544
+ ],
545
+ description: "Path to an SSL pfx file or content of an SSL pfx file.",
546
+ simpleType: "string",
547
+ multiple: true,
548
+ },
549
+ "https-pfx-reset": {
550
+ configs: [
551
+ {
552
+ description:
553
+ "Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.",
478
554
  multiple: false,
479
- description: "Path to an SSL pfx file.",
480
555
  path: "https.pfx",
556
+ type: "reset",
481
557
  },
482
558
  ],
483
- description: "Path to an SSL pfx file.",
484
- simpleType: "string",
559
+ description:
560
+ "Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file.",
485
561
  multiple: false,
562
+ simpleType: "boolean",
486
563
  },
487
564
  "https-cert": {
488
565
  configs: [
489
566
  {
490
567
  type: "string",
568
+ multiple: true,
569
+ description:
570
+ "Path to an SSL certificate or content of an SSL certificate.",
571
+ path: "https.cert[]",
572
+ },
573
+ ],
574
+ description: "Path to an SSL certificate or content of an SSL certificate.",
575
+ simpleType: "string",
576
+ multiple: true,
577
+ },
578
+ "https-cert-reset": {
579
+ configs: [
580
+ {
581
+ description:
582
+ "Clear all items provided in 'https.cert' configuration. Path to an SSL certificate or content of an SSL certificate.",
491
583
  multiple: false,
492
- description: "Path to an SSL certificate.",
493
584
  path: "https.cert",
585
+ type: "reset",
586
+ },
587
+ ],
588
+ description:
589
+ "Clear all items provided in 'https.cert' configuration. Path to an SSL certificate or content of an SSL certificate.",
590
+ multiple: false,
591
+ simpleType: "boolean",
592
+ },
593
+ "https-crl": {
594
+ configs: [
595
+ {
596
+ description:
597
+ "Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).",
598
+ multiple: true,
599
+ path: "https.crl[]",
600
+ type: "string",
494
601
  },
495
602
  ],
496
- description: "Path to an SSL certificate.",
603
+ description:
604
+ "Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).",
605
+ multiple: true,
497
606
  simpleType: "string",
607
+ },
608
+ "https-crl-reset": {
609
+ configs: [
610
+ {
611
+ description:
612
+ "Clear all items provided in 'https.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).",
613
+ multiple: false,
614
+ path: "https.crl",
615
+ type: "reset",
616
+ },
617
+ ],
618
+ description:
619
+ "Clear all items provided in 'https.crl' configuration. Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).",
498
620
  multiple: false,
621
+ simpleType: "boolean",
499
622
  },
500
623
  ipc: {
501
624
  configs: [
@@ -534,6 +657,23 @@ module.exports = {
534
657
  simpleType: "boolean",
535
658
  multiple: false,
536
659
  },
660
+ "magic-html": {
661
+ configs: [
662
+ {
663
+ type: "boolean",
664
+ multiple: false,
665
+ description:
666
+ "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
667
+ path: "magicHtml",
668
+ },
669
+ ],
670
+ description:
671
+ "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
672
+ negatedDescription:
673
+ "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
674
+ simpleType: "boolean",
675
+ multiple: false,
676
+ },
537
677
  open: {
538
678
  configs: [
539
679
  {
package/client/index.js CHANGED
@@ -23,6 +23,16 @@ var options = {
23
23
  };
24
24
  var parsedResourceQuery = parseURL(__resourceQuery);
25
25
 
26
+ if (parsedResourceQuery.hot === "true") {
27
+ options.hot = true;
28
+ log.info("Hot Module Replacement enabled.");
29
+ }
30
+
31
+ if (parsedResourceQuery["live-reload"] === "true") {
32
+ options.liveReload = true;
33
+ log.info("Live Reloading enabled.");
34
+ }
35
+
26
36
  if (parsedResourceQuery.logging) {
27
37
  options.logging = parsedResourceQuery.logging;
28
38
  }
@@ -67,6 +77,7 @@ var onSocketMessage = {
67
77
  sendMessage("Invalid");
68
78
  },
69
79
  hash: function hash(_hash) {
80
+ status.previousHash = status.currentHash;
70
81
  status.currentHash = _hash;
71
82
  },
72
83
  logging: setAllLogLevel,
@@ -127,9 +138,9 @@ var onSocketMessage = {
127
138
  log.warn(strippedWarnings[i]);
128
139
  }
129
140
 
130
- var needShowOverlay = typeof options.overlay === "boolean" ? options.overlay : options.overlay && options.overlay.warnings;
141
+ var needShowOverlayForWarnings = typeof options.overlay === "boolean" ? options.overlay : options.overlay && options.overlay.warnings;
131
142
 
132
- if (needShowOverlay) {
143
+ if (needShowOverlayForWarnings) {
133
144
  show(_warnings, "warnings");
134
145
  }
135
146
 
@@ -148,9 +159,9 @@ var onSocketMessage = {
148
159
  log.error(strippedErrors[i]);
149
160
  }
150
161
 
151
- var needShowOverlay = typeof options.overlay === "boolean" ? options.overlay : options.overlay && options.overlay.errors;
162
+ var needShowOverlayForErrors = typeof options.overlay === "boolean" ? options.overlay : options.overlay && options.overlay.errors;
152
163
 
153
- if (needShowOverlay) {
164
+ if (needShowOverlayForErrors) {
154
165
  show(_errors, "errors");
155
166
  }
156
167
  },
@@ -158,7 +169,12 @@ var onSocketMessage = {
158
169
  log.error(_error);
159
170
  },
160
171
  close: function close() {
161
- log.error("Disconnected!");
172
+ log.info("Disconnected!");
173
+
174
+ if (options.overlay) {
175
+ hide();
176
+ }
177
+
162
178
  sendMessage("Close");
163
179
  }
164
180
  };
@@ -5630,7 +5630,7 @@ module.exports = {
5630
5630
  \***************************************************/
5631
5631
  /***/ (function(module) {
5632
5632
 
5633
- module.exports = '1.5.1';
5633
+ module.exports = '1.5.2';
5634
5634
 
5635
5635
  /***/ }),
5636
5636
 
@@ -19,7 +19,7 @@ function stripAnsi(string) {
19
19
  throw new TypeError("Expected a `string`, got `".concat(typeof string, "`"));
20
20
  }
21
21
 
22
- return string.replace((0,ansi_regex__WEBPACK_IMPORTED_MODULE_0__.default)(), '');
22
+ return string.replace((0,ansi_regex__WEBPACK_IMPORTED_MODULE_0__["default"])(), '');
23
23
  }
24
24
 
25
25
  /***/ }),
@@ -39,7 +39,7 @@ function ansiRegex() {
39
39
  _ref$onlyFirst = _ref.onlyFirst,
40
40
  onlyFirst = _ref$onlyFirst === void 0 ? false : _ref$onlyFirst;
41
41
 
42
- var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
42
+ var pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
43
43
  return new RegExp(pattern, onlyFirst ? undefined : 'g');
44
44
  }
45
45
 
@@ -110,7 +110,7 @@ var __webpack_exports__ = {};
110
110
  __webpack_require__.r(__webpack_exports__);
111
111
  /* harmony import */ var strip_ansi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! strip-ansi */ "./node_modules/strip-ansi/index.js");
112
112
 
113
- /* harmony default export */ __webpack_exports__["default"] = (strip_ansi__WEBPACK_IMPORTED_MODULE_0__.default);
113
+ /* harmony default export */ __webpack_exports__["default"] = (strip_ansi__WEBPACK_IMPORTED_MODULE_0__["default"]);
114
114
  }();
115
115
  var __webpack_export_target__ = exports;
116
116
  for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
package/client/overlay.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // The error overlay is inspired (and mostly copied) from Create React App (https://github.com/facebookincubator/create-react-app)
2
2
  // They, in turn, got inspired by webpack-hot-middleware (https://github.com/glenjamin/webpack-hot-middleware).
3
- import ansiHTML from "ansi-html";
3
+ import ansiHTML from "ansi-html-community";
4
4
  import { encode } from "html-entities";
5
5
  var colors = {
6
6
  reset: ["transparent", "transparent"],
@@ -8,21 +8,13 @@ function reloadApp(_ref, status) {
8
8
 
9
9
  if (status.isUnloading) {
10
10
  return;
11
- } // TODO Workaround for webpack v4, `__webpack_hash__` is not replaced without HotModuleReplacement plugin
12
-
11
+ }
13
12
 
14
- var webpackHash = // eslint-disable-next-line camelcase
15
- typeof __webpack_hash__ !== "undefined" ? // eslint-disable-next-line camelcase
16
- __webpack_hash__ : status.previousHash || "";
17
- var isInitial = status.currentHash.indexOf(webpackHash) === 0;
13
+ var currentHash = status.currentHash,
14
+ previousHash = status.previousHash;
15
+ var isInitial = currentHash.indexOf(previousHash) >= 0;
18
16
 
19
17
  if (isInitial) {
20
- var isLegacyInitial = webpackHash === "" && hot === false && liveReload === true;
21
-
22
- if (isLegacyInitial) {
23
- status.previousHash = status.currentHash;
24
- }
25
-
26
18
  return;
27
19
  }
28
20