@rspack/dev-server 1.0.0-alpha.3 → 1.0.0-alpha.5

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/dist/ansiHTML.js CHANGED
@@ -258,7 +258,7 @@ function _setTags(colors) {
258
258
  var color = _styles[code];
259
259
  var oriColor = colors[color] || "000";
260
260
  _openTags[code] = "color:#" + oriColor;
261
- code = parseInt(code);
261
+ code = Number.parseInt(code);
262
262
  _openTags[(code + 10).toString()] = "background:#" + oriColor;
263
263
  }
264
264
  }
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getRspackMemoryAssets = void 0;
7
- const crypto_1 = __importDefault(require("crypto"));
8
- const path_1 = require("path");
9
- const url_1 = require("url");
7
+ const node_crypto_1 = __importDefault(require("node:crypto"));
8
+ const node_path_1 = require("node:path");
9
+ const node_url_1 = require("node:url");
10
10
  const mime_types_1 = __importDefault(require("mime-types"));
11
11
  function etag(buf) {
12
- const hash = crypto_1.default.createHash("sha256").update(buf).digest("hex");
12
+ const hash = node_crypto_1.default.createHash("sha256").update(buf).digest("hex");
13
13
  const etag = hash;
14
14
  return etag;
15
15
  }
@@ -24,7 +24,7 @@ function getRspackMemoryAssets(compiler, rdm) {
24
24
  }
25
25
  // css hmr will append query string, so here need to remove query string
26
26
  // @ts-expect-error
27
- const path = (0, url_1.parse)(url).pathname;
27
+ const path = (0, node_url_1.parse)(url).pathname;
28
28
  // asset name is not start with /, so path need to slice 1
29
29
  // @ts-expect-error
30
30
  const filename = path.startsWith(publicPath)
@@ -50,7 +50,7 @@ function getRspackMemoryAssets(compiler, rdm) {
50
50
  else {
51
51
  contentType =
52
52
  // @ts-expect-error
53
- mime_types_1.default.contentType((0, path_1.extname)(path)) || "text/plain; charset=utf-8";
53
+ mime_types_1.default.contentType((0, node_path_1.extname)(path)) || "text/plain; charset=utf-8";
54
54
  }
55
55
  const calcEtag = etag(buffer);
56
56
  const oldEtag = req.headers["if-none-match"];
package/dist/patch.js CHANGED
@@ -21,7 +21,7 @@ function applyDevServerPatch() {
21
21
  webpack_dev_server_1.default.prototype.sendStats = function sendStats__rspack_patched(
22
22
  // @ts-expect-error
23
23
  ...args) {
24
- let stats = args[1];
24
+ const stats = args[1];
25
25
  if (!stats) {
26
26
  return;
27
27
  }
package/dist/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
- import type { Server } from "http";
4
- import type { Socket } from "net";
3
+ import type { Server } from "node:http";
4
+ import type { Socket } from "node:net";
5
5
  import { type Compiler, MultiCompiler } from "@rspack/core";
6
6
  import type { FSWatcher } from "chokidar";
7
7
  import WebpackDevServer from "webpack-dev-server";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/dev-server",
3
- "version": "1.0.0-alpha.3",
3
+ "version": "1.0.0-alpha.5",
4
4
  "license": "MIT",
5
5
  "description": "Development server for rspack",
6
6
  "main": "./dist/index.js",
@@ -33,12 +33,12 @@
33
33
  "@types/express": "4.17.21",
34
34
  "@types/mime-types": "2.1.4",
35
35
  "@types/ws": "8.5.10",
36
- "@rspack/core": "1.0.0-alpha.3",
37
- "@rspack/plugin-react-refresh": "1.0.0-alpha.3",
38
- "@rspack/dev-server": "1.0.0-alpha.3"
36
+ "@rspack/dev-server": "1.0.0-alpha.5",
37
+ "@rspack/core": "1.0.0-alpha.5",
38
+ "@rspack/plugin-react-refresh": "1.0.0-alpha.5"
39
39
  },
40
40
  "dependencies": {
41
- "chokidar": "3.5.3",
41
+ "chokidar": "3.6.0",
42
42
  "connect-history-api-fallback": "2.0.0",
43
43
  "express": "4.19.2",
44
44
  "http-proxy-middleware": "2.0.6",