webpack-dev-server 4.15.1 → 5.0.0

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
@@ -83,22 +83,26 @@ Options:
83
83
  -c, --config <value...> Provide path to a webpack configuration file e.g. ./webpack.config.js.
84
84
  --config-name <value...> Name of the configuration to use.
85
85
  -m, --merge Merge two or more configurations using 'webpack-merge'.
86
+ --disable-interpret Disable interpret for loading the config file.
86
87
  --env <value...> Environment passed to the configuration when it is a function.
87
88
  --node-env <value> Sets process.env.NODE_ENV to the specified value.
89
+ --define-process-env-node-env <value> Sets process.env.NODE_ENV to the specified value. (Currently an alias for `--node-env`)
90
+ --analyze It invokes webpack-bundle-analyzer plugin to get bundle information.
88
91
  --progress [value] Print compilation progress during build.
89
92
  -j, --json [value] Prints result as JSON or store it in a file.
90
- -d, --devtool <value> Determine source maps to use.
91
- --no-devtool Do not generate source maps.
92
- --entry <value...> The entry point(s) of your application e.g. ./src/main.js.
93
- --mode <value> Defines the mode to pass to webpack.
93
+ --fail-on-warnings Stop webpack-cli process with non-zero exit code on warnings from webpack
94
+ -d, --devtool <value> A developer tool to enhance debugging (false | eval | [inline-|hidden-|eval-][nosources-][cheap-[module-]]source-map).
95
+ --no-devtool Negative 'devtool' option.
96
+ --entry <value...> A module that is loaded upon startup. Only the last one is exported.
97
+ --mode <value> Enable production optimizations or development hints.
94
98
  --name <value> Name of the configuration. Used when loading multiple configurations.
95
- -o, --output-path <value> Output location of the file generated by webpack e.g. ./dist/.
96
- --stats [value] It instructs webpack on how to treat the stats e.g. verbose.
97
- --no-stats Disable stats output.
98
- -t, --target <value...> Sets the build target e.g. node.
99
+ -o, --output-path <value> The output directory as **absolute path** (required).
100
+ --stats [value] Stats options object or preset name.
101
+ --no-stats Negative 'stats' option.
102
+ -t, --target <value...> Environment to build for. Environment to build for. An array of environments to build for all of them when possible.
99
103
  --no-target Negative 'target' option.
100
104
  --watch-options-stdin Stop watching when stdin stream has ended.
101
- --no-watch-options-stdin Do not stop watching when stdin stream has ended.
105
+ --no-watch-options-stdin Negative 'watch-options-stdin' option.
102
106
  --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').
103
107
  --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').
104
108
  --bonjour Allows to broadcasts dev server via ZeroConf networking on start.
@@ -111,6 +115,8 @@ Options:
111
115
  --no-client-overlay-errors Disables the full-screen overlay in the browser when there are compiler errors.
112
116
  --client-overlay-warnings Enables a full-screen overlay in the browser when there are compiler warnings.
113
117
  --no-client-overlay-warnings Disables the full-screen overlay in the browser when there are compiler warnings.
118
+ --client-overlay-runtime-errors Enables a full-screen overlay in the browser when there are uncaught runtime errors.
119
+ --no-client-overlay-runtime-errors Disables the full-screen overlay in the browser when there are uncaught runtime errors.
114
120
  --client-overlay-trusted-types-policy-name <value> The name of a Trusted Types policy for the overlay. Defaults to 'webpack-dev-server#overlay'.
115
121
  --client-progress Prints compilation progress in percentage in the browser.
116
122
  --no-client-progress Does not print compilation progress in percentage in the browser.
@@ -131,35 +137,13 @@ Options:
131
137
  --host <value> Allows to specify a hostname to use.
132
138
  --hot [value] Enables Hot Module Replacement.
133
139
  --no-hot Disables Hot Module Replacement.
134
- --http2 Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.
135
- --no-http2 Does not serve over HTTP/2 using SPDY.
136
- --https Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.
137
- --no-https Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).
138
- --https-passphrase <value> Passphrase for a pfx file. Deprecated, use the `server.options.passphrase` option.
139
- --https-request-cert Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.
140
- --no-https-request-cert Does not request for an SSL certificate.
141
- --https-ca <value...> Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.
142
- --https-ca-reset Clear all items provided in 'https.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.
143
- --https-cacert <value...> Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.
144
- --https-cacert-reset Clear all items provided in 'https.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.
145
- --https-cert <value...> Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option.
146
- --https-cert-reset Clear all items provided in 'https.cert' configuration. Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option.
147
- --https-crl <value...> Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated, use the `server.options.crl` option.
148
- --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). Deprecated, use the `server.options.crl` option.
149
- --https-key <value...> Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option.
150
- --https-key-reset Clear all items provided in 'https.key' configuration. Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option.
151
- --https-pfx <value...> Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option.
152
- --https-pfx-reset Clear all items provided in 'https.pfx' configuration. Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option.
153
140
  --ipc [value] Listen to a unix socket.
154
141
  --live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default).
155
142
  --no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default).
156
- --magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
157
- --no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
158
143
  --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).
159
144
  --no-open Does not open the default browser.
160
145
  --open-target <value...> Opens specified page in browser.
161
146
  --open-app-name <value...> Open specified browser.
162
- --open-app <value...> Open specified browser. Deprecated: please use '--open-app-name'.
163
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).
164
148
  --open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser.
165
149
  --open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser.
@@ -170,8 +154,6 @@ Options:
170
154
  --no-server-options-request-cert Does not request for an SSL certificate.
171
155
  --server-options-ca <value...> Path to an SSL CA certificate or content of an SSL CA certificate.
172
156
  --server-options-ca-reset Clear all items provided in 'server.options.ca' configuration. Path to an SSL CA certificate or content of an SSL CA certificate.
173
- --server-options-cacert <value...> Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.
174
- --server-options-cacert-reset Clear all items provided in 'server.options.cacert' configuration. Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option.
175
157
  --server-options-cert <value...> Path to an SSL certificate or content of an SSL certificate.
176
158
  --server-options-cert-reset Clear all items provided in 'server.options.cert' configuration. Path to an SSL certificate or content of an SSL certificate.
177
159
  --server-options-crl <value...> Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists).
@@ -192,7 +174,6 @@ Options:
192
174
  --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.
193
175
  --watch-files <value...> Allows to configure list of globs/directories/files to watch for file changes.
194
176
  --watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.
195
- --web-socket-server <value> Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
196
177
  --no-web-socket-server Disallows to set web socket server and options.
197
178
  --web-socket-server-type <value> Allows to set web socket server and options (by default 'ws').
198
179
 
@@ -91,7 +91,7 @@ const runCli = (cli) => {
91
91
  (error) => {
92
92
  console.error(error);
93
93
  process.exitCode = 1;
94
- }
94
+ },
95
95
  );
96
96
  } else {
97
97
  // eslint-disable-next-line import/no-dynamic-require
@@ -147,8 +147,8 @@ if (!cli.installed) {
147
147
 
148
148
  console.error(
149
149
  `We will use "${packageManager}" to install the CLI via "${packageManager} ${installOptions.join(
150
- " "
151
- )} ${cli.package}".`
150
+ " ",
151
+ )} ${cli.package}".`,
152
152
  );
153
153
 
154
154
  const question = `Do you want to install 'webpack-cli' (yes/no): `;
@@ -170,7 +170,7 @@ if (!cli.installed) {
170
170
  if (!normalizedAnswer) {
171
171
  console.error(
172
172
  "You need to install 'webpack-cli' to use webpack via CLI.\n" +
173
- "You can also install the CLI manually."
173
+ "You can also install the CLI manually.",
174
174
  );
175
175
 
176
176
  return;
@@ -182,7 +182,7 @@ if (!cli.installed) {
182
182
  cli.package
183
183
  }' (running '${packageManager} ${installOptions.join(" ")} ${
184
184
  cli.package
185
- }')...`
185
+ }')...`,
186
186
  );
187
187
 
188
188
  runCommand(packageManager, installOptions.concat(cli.package))
@@ -1,8 +1,8 @@
1
1
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
2
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
3
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import SockJS from "../modules/sockjs-client/index.js";
7
7
  import { log } from "../utils/log.js";
8
8
  var SockJSClient = /*#__PURE__*/function () {
@@ -1,8 +1,8 @@
1
1
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
2
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
3
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  import { log } from "../utils/log.js";
7
7
  var WebSocketClient = /*#__PURE__*/function () {
8
8
  /**
package/client/index.js CHANGED
@@ -1,8 +1,8 @@
1
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
3
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
5
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  /* global __resourceQuery, __webpack_hash__ */
7
7
  /// <reference types="webpack/module" />
8
8
  import webpackHotLog from "webpack/hot/log.js";
@@ -62,9 +62,8 @@ var decodeOverlayOptions = function decodeOverlayOptions(overlayOptions) {
62
62
  */
63
63
  var status = {
64
64
  isUnloading: false,
65
- // TODO Workaround for webpack v4, `__webpack_hash__` is not replaced without HotModuleReplacement
66
65
  // eslint-disable-next-line camelcase
67
- currentHash: typeof __webpack_hash__ !== "undefined" ? __webpack_hash__ : ""
66
+ currentHash: __webpack_hash__
68
67
  };
69
68
 
70
69
  /** @type {Options} */
@@ -226,14 +225,6 @@ var onSocketMessage = {
226
225
  }
227
226
  reloadApp(options, status);
228
227
  },
229
- // TODO: remove in v5 in favor of 'static-changed'
230
- /**
231
- * @param {string} file
232
- */
233
- "content-changed": function contentChanged(file) {
234
- log.info("".concat(file ? "\"".concat(file, "\"") : "Content", " from static directory was changed. Reloading..."));
235
- self.location.reload();
236
- },
237
228
  /**
238
229
  * @param {string} file
239
230
  */