@rspack/dev-server 0.6.5 → 0.7.0-beta.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/dist/config.d.ts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +6 -5
- package/dist/server.d.ts +2 -2
- package/dist/server.js +1 -1
- package/package.json +4 -4
package/dist/config.d.ts
CHANGED
package/dist/middleware.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Compiler } from "@rspack/core";
|
|
2
|
-
import wdm from "webpack-dev-middleware";
|
|
3
2
|
import type { RequestHandler } from "express";
|
|
3
|
+
import wdm from "webpack-dev-middleware";
|
|
4
4
|
export declare function getRspackMemoryAssets(compiler: Compiler, rdm: ReturnType<typeof wdm>): RequestHandler;
|
package/dist/middleware.js
CHANGED
|
@@ -4,10 +4,10 @@ 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
|
|
7
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
8
8
|
const mime_types_1 = __importDefault(require("mime-types"));
|
|
9
|
+
const path_1 = require("path");
|
|
9
10
|
const url_1 = require("url");
|
|
10
|
-
const crypto_1 = __importDefault(require("crypto"));
|
|
11
11
|
function etag(buf) {
|
|
12
12
|
const hash = crypto_1.default.createHash("sha256").update(buf).digest("hex");
|
|
13
13
|
const etag = hash;
|
|
@@ -18,7 +18,7 @@ function getRspackMemoryAssets(compiler, rdm) {
|
|
|
18
18
|
? compiler.options.output.publicPath.replace(/\/$/, "") + "/"
|
|
19
19
|
: "/";
|
|
20
20
|
return function (req, res, next) {
|
|
21
|
-
var _a;
|
|
21
|
+
var _a, _b;
|
|
22
22
|
const { method, url } = req;
|
|
23
23
|
if (method !== "GET") {
|
|
24
24
|
return next();
|
|
@@ -33,12 +33,13 @@ function getRspackMemoryAssets(compiler, rdm) {
|
|
|
33
33
|
path.slice(publicPath.length)
|
|
34
34
|
: // @ts-expect-error
|
|
35
35
|
path.slice(1);
|
|
36
|
-
const buffer = (_a = compiler.getAsset(filename)) !== null &&
|
|
36
|
+
const buffer = (_b = (_a = compiler._lastCompilation) === null || _a === void 0 ? void 0 : _a.getAsset(filename)) !== null && _b !== void 0 ? _b : (() => {
|
|
37
|
+
var _a;
|
|
37
38
|
const { index } = rdm.context.options;
|
|
38
39
|
const indexValue = typeof index === "undefined" || typeof index === "boolean"
|
|
39
40
|
? "index.html"
|
|
40
41
|
: index;
|
|
41
|
-
return compiler.getAsset(filename + indexValue);
|
|
42
|
+
return (_a = compiler._lastCompilation) === null || _a === void 0 ? void 0 : _a.getAsset(filename + indexValue);
|
|
42
43
|
})();
|
|
43
44
|
if (!buffer) {
|
|
44
45
|
return next();
|
package/dist/server.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { Compiler, MultiCompiler } from "@rspack/core";
|
|
4
|
-
import type { Socket } from "net";
|
|
5
4
|
import type { FSWatcher } from "chokidar";
|
|
6
5
|
import type { Server } from "http";
|
|
6
|
+
import type { Socket } from "net";
|
|
7
7
|
import WebpackDevServer from "webpack-dev-server";
|
|
8
|
-
import type {
|
|
8
|
+
import type { DevServer, ResolvedDevServer } from "./config";
|
|
9
9
|
export declare class RspackDevServer extends WebpackDevServer {
|
|
10
10
|
/**
|
|
11
11
|
* resolved after `normalizedOptions`
|
package/dist/server.js
CHANGED
|
@@ -15,8 +15,8 @@ exports.RspackDevServer = void 0;
|
|
|
15
15
|
*/
|
|
16
16
|
const node_path_1 = __importDefault(require("node:path"));
|
|
17
17
|
const core_1 = require("@rspack/core");
|
|
18
|
-
const webpack_dev_middleware_1 = __importDefault(require("webpack-dev-middleware"));
|
|
19
18
|
const fs_1 = __importDefault(require("fs"));
|
|
19
|
+
const webpack_dev_middleware_1 = __importDefault(require("webpack-dev-middleware"));
|
|
20
20
|
const webpack_dev_server_1 = __importDefault(require("webpack-dev-server"));
|
|
21
21
|
const patch_1 = require("./patch");
|
|
22
22
|
(0, patch_1.applyDevServerPatch)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/dev-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Development server for rspack",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@types/express": "4.17.21",
|
|
30
30
|
"@types/mime-types": "2.1.4",
|
|
31
31
|
"@types/ws": "8.5.10",
|
|
32
|
-
"@rspack/core": "0.
|
|
33
|
-
"@rspack/
|
|
34
|
-
"@rspack/
|
|
32
|
+
"@rspack/core": "0.7.0-beta.0",
|
|
33
|
+
"@rspack/plugin-react-refresh": "0.7.0-beta.0",
|
|
34
|
+
"@rspack/dev-server": "0.7.0-beta.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"chokidar": "3.5.3",
|