@rspack/dev-server 0.0.0-20230208075048 → 0.0.0-20230220035042
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/CHANGELOG.md +19 -5
- package/LICENSE +2 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/config.ts +1 -0
- package/src/server.ts +28 -4
- package/tests/__snapshots__/normalizeOptions.test.ts.snap +19 -78
- package/tests/normalizeOptions.test.ts +9 -17
- package/tsconfig.tsbuildinfo +1 -1
- package/tests/e2e-fixtures/react/node_modules/react/LICENSE +0 -21
- package/tests/e2e-fixtures/react/node_modules/react/README.md +0 -37
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +0 -1296
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +0 -10
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +0 -10
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1314
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -11
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +0 -11
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.development.js +0 -2739
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.production.min.js +0 -26
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.development.js +0 -20
- package/tests/e2e-fixtures/react/node_modules/react/cjs/react.shared-subset.production.min.js +0 -10
- package/tests/e2e-fixtures/react/node_modules/react/index.js +0 -7
- package/tests/e2e-fixtures/react/node_modules/react/jsx-dev-runtime.js +0 -7
- package/tests/e2e-fixtures/react/node_modules/react/jsx-runtime.js +0 -7
- package/tests/e2e-fixtures/react/node_modules/react/package.json +0 -47
- package/tests/e2e-fixtures/react/node_modules/react/react.shared-subset.js +0 -7
- package/tests/e2e-fixtures/react/node_modules/react/umd/react.development.js +0 -3342
- package/tests/e2e-fixtures/react/node_modules/react/umd/react.production.min.js +0 -31
- package/tests/e2e-fixtures/react/node_modules/react/umd/react.profiling.min.js +0 -31
- package/tests/e2e-fixtures/react/node_modules/react-dom/LICENSE +0 -21
- package/tests/e2e-fixtures/react/node_modules/react-dom/README.md +0 -60
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.development.js +0 -7018
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +0 -93
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js +0 -7078
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +0 -101
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -7003
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -96
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +0 -7059
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +0 -102
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +0 -1741
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +0 -40
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.development.js +0 -29868
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.production.min.js +0 -323
- package/tests/e2e-fixtures/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +0 -367
- package/tests/e2e-fixtures/react/node_modules/react-dom/client.js +0 -25
- package/tests/e2e-fixtures/react/node_modules/react-dom/index.js +0 -38
- package/tests/e2e-fixtures/react/node_modules/react-dom/package.json +0 -62
- package/tests/e2e-fixtures/react/node_modules/react-dom/profiling.js +0 -38
- package/tests/e2e-fixtures/react/node_modules/react-dom/server.browser.js +0 -17
- package/tests/e2e-fixtures/react/node_modules/react-dom/server.js +0 -3
- package/tests/e2e-fixtures/react/node_modules/react-dom/server.node.js +0 -17
- package/tests/e2e-fixtures/react/node_modules/react-dom/test-utils.js +0 -7
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.development.js +0 -7015
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server-legacy.browser.production.min.js +0 -75
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +0 -7000
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +0 -76
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +0 -1737
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +0 -33
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.development.js +0 -29869
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.production.min.js +0 -267
- package/tests/e2e-fixtures/react/node_modules/react-dom/umd/react-dom.profiling.min.js +0 -285
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
# rspack-dev-server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20230220035042
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- b67418968: chore: 🤖 use module path instead of module id in diagnositc
|
|
7
8
|
- 962f8a251: fix: should create different module with different module rule
|
|
9
|
+
- 1c7ab6dfd: feat: rspack-cli and devServer support multiCompiler
|
|
8
10
|
- 766c94042: fix rust test
|
|
11
|
+
- 035c15953: basic implementation of compilation.hooks.optimizeChunkModules
|
|
12
|
+
- c1f19b817: align webpack config optimization.sideEffects
|
|
13
|
+
- Updated dependencies [b67418968]
|
|
14
|
+
- Updated dependencies [f3e0d8287]
|
|
9
15
|
- Updated dependencies [962f8a251]
|
|
16
|
+
- Updated dependencies [327b600d6]
|
|
17
|
+
- Updated dependencies [1c7ab6dfd]
|
|
10
18
|
- Updated dependencies [766c94042]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
- Updated dependencies [e5d628ce3]
|
|
20
|
+
- Updated dependencies [2d395d6b0]
|
|
21
|
+
- Updated dependencies [035c15953]
|
|
22
|
+
- Updated dependencies [b694d4a58]
|
|
23
|
+
- Updated dependencies [60fb4c5bf]
|
|
24
|
+
- Updated dependencies [c1f19b817]
|
|
25
|
+
- @rspack/core@0.0.0-20230220035042
|
|
26
|
+
- @rspack/dev-client@0.0.0-20230220035042
|
|
27
|
+
- @rspack/dev-middleware@0.0.0-20230220035042
|
|
28
|
+
- @rspack/dev-server@0.0.0-20230220035042
|
|
15
29
|
|
|
16
30
|
## 0.0.22
|
|
17
31
|
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2022-present
|
|
3
|
+
Copyright (c) 2022-present Bytedance, Inc. and its affiliates.
|
|
4
|
+
|
|
4
5
|
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/config.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface ResolvedDevServer extends DevServer {
|
|
|
6
6
|
static: false | Array<WebpackDevServer.NormalizedStatic>;
|
|
7
7
|
devMiddleware: DevServer["devMiddleware"];
|
|
8
8
|
hot: boolean;
|
|
9
|
+
host?: string;
|
|
9
10
|
open: WebpackDevServer.Open[];
|
|
10
11
|
magicHtml: boolean;
|
|
11
12
|
liveReload: boolean;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IACnD,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACzD,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAE1C,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,KAAK,GAAG,gBAAgB,CAAC,4BAA4B,CAAC;IACvE,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IACzC,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,KAAK,GAAG,gBAAgB,CAAC,gCAAgC,CAAC;IAC9E,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAC;CAC1C"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IACnD,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACzD,aAAa,EAAE,SAAS,CAAC,eAAe,CAAC,CAAC;IAE1C,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,KAAK,GAAG,gBAAgB,CAAC,4BAA4B,CAAC;IACvE,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC;IACzC,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC;IACzE,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,KAAK,GAAG,gBAAgB,CAAC,gCAAgC,CAAC;IAC9E,MAAM,EAAE,gBAAgB,CAAC,mBAAmB,CAAC;IAC7C,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,gBAAgB,CAAC,UAAU,EAAE,CAAC;CAC1C"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/dev-server",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-20230220035042",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"tsm": "^2.2.2",
|
|
11
10
|
"typescript": "^4.7.4",
|
|
12
11
|
"@types/ws": "8.5.3",
|
|
13
12
|
"@types/node": "16.11.7",
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
"@types/connect-history-api-fallback": "1.3.5",
|
|
16
15
|
"fs-extra": "11.1.0",
|
|
17
16
|
"puppeteer": "19.4.0",
|
|
18
|
-
"@rspack/core": "0.0.0-
|
|
17
|
+
"@rspack/core": "0.0.0-20230220035042"
|
|
19
18
|
},
|
|
20
19
|
"dependencies": {
|
|
21
20
|
"express": "4.18.1",
|
|
@@ -24,12 +23,12 @@
|
|
|
24
23
|
"webpack-dev-server": "4.11.1",
|
|
25
24
|
"connect-history-api-fallback": "2.0.0",
|
|
26
25
|
"http-proxy-middleware": "2.0.6",
|
|
27
|
-
"@rspack/dev-
|
|
28
|
-
"@rspack/dev-
|
|
29
|
-
"@rspack/dev-
|
|
26
|
+
"@rspack/dev-client": "0.0.0-20230220035042",
|
|
27
|
+
"@rspack/dev-middleware": "0.0.0-20230220035042",
|
|
28
|
+
"@rspack/dev-server": "0.0.0-20230220035042"
|
|
30
29
|
},
|
|
31
30
|
"peerDependencies": {
|
|
32
|
-
"@rspack/core": "0.0.0-
|
|
31
|
+
"@rspack/core": "0.0.0-20230220035042"
|
|
33
32
|
},
|
|
34
33
|
"scripts": {
|
|
35
34
|
"build": "rm -rf dist/ && tsc",
|
package/src/config.ts
CHANGED
package/src/server.ts
CHANGED
|
@@ -26,10 +26,7 @@ export class RspackDevServer extends WebpackDevServer {
|
|
|
26
26
|
|
|
27
27
|
addAdditionEntires(compiler: Compiler) {
|
|
28
28
|
const additionalEntries: string[] = [];
|
|
29
|
-
|
|
30
|
-
const isWebTarget =
|
|
31
|
-
compiler.options.target.includes("web") ||
|
|
32
|
-
compiler.options.target.includes("webworker");
|
|
29
|
+
const isWebTarget = isWebTarget2(compiler);
|
|
33
30
|
if (this.options.client && isWebTarget) {
|
|
34
31
|
let webSocketURLStr = "";
|
|
35
32
|
|
|
@@ -448,3 +445,30 @@ export class RspackDevServer extends WebpackDevServer {
|
|
|
448
445
|
});
|
|
449
446
|
}
|
|
450
447
|
}
|
|
448
|
+
|
|
449
|
+
// TODO: use WebpackDevServer.isWebTarget instead of this once we have a new webpack-dev-server version
|
|
450
|
+
function isWebTarget2(compiler: Compiler): boolean {
|
|
451
|
+
if (
|
|
452
|
+
compiler.options.resolve.conditionNames &&
|
|
453
|
+
compiler.options.resolve.conditionNames.includes("browser")
|
|
454
|
+
) {
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
const target = compiler.options.target;
|
|
458
|
+
const webTargets = [
|
|
459
|
+
"web",
|
|
460
|
+
"webworker",
|
|
461
|
+
"electron-preload",
|
|
462
|
+
"electron-renderer",
|
|
463
|
+
"node-webkit",
|
|
464
|
+
undefined,
|
|
465
|
+
null
|
|
466
|
+
];
|
|
467
|
+
if (Array.isArray(target)) {
|
|
468
|
+
return target.some(r => webTargets.includes(r));
|
|
469
|
+
}
|
|
470
|
+
if (typeof target === "string") {
|
|
471
|
+
return webTargets.includes(target);
|
|
472
|
+
}
|
|
473
|
+
return false;
|
|
474
|
+
}
|
|
@@ -12,83 +12,6 @@ exports[`normalize options snapshot additional entires should added 1`] = `
|
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
|
-
exports[`normalize options snapshot compier.options.devServer should be equal to server.options when devServer is undefined 1`] = `
|
|
16
|
-
{
|
|
17
|
-
"builtins": {
|
|
18
|
-
"browserslist": undefined,
|
|
19
|
-
"decorator": {
|
|
20
|
-
"emitMetadata": true,
|
|
21
|
-
"legacy": true,
|
|
22
|
-
},
|
|
23
|
-
"define": {},
|
|
24
|
-
"emotion": undefined,
|
|
25
|
-
"html": [],
|
|
26
|
-
"minify": {
|
|
27
|
-
"enable": true,
|
|
28
|
-
"passes": 1,
|
|
29
|
-
},
|
|
30
|
-
"react": {
|
|
31
|
-
"development": true,
|
|
32
|
-
"refresh": true,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
"devServer": {
|
|
36
|
-
"allowedHosts": "auto",
|
|
37
|
-
"bonjour": false,
|
|
38
|
-
"client": {
|
|
39
|
-
"logging": "info",
|
|
40
|
-
"overlay": true,
|
|
41
|
-
"reconnect": 10,
|
|
42
|
-
"webSocketURL": {},
|
|
43
|
-
},
|
|
44
|
-
"compress": true,
|
|
45
|
-
"devMiddleware": {},
|
|
46
|
-
"historyApiFallback": false,
|
|
47
|
-
"host": undefined,
|
|
48
|
-
"hot": true,
|
|
49
|
-
"liveReload": true,
|
|
50
|
-
"magicHtml": true,
|
|
51
|
-
"open": [],
|
|
52
|
-
"port": 8080,
|
|
53
|
-
"server": {
|
|
54
|
-
"options": {},
|
|
55
|
-
"type": "http",
|
|
56
|
-
},
|
|
57
|
-
"setupExitSignals": true,
|
|
58
|
-
"static": [
|
|
59
|
-
{
|
|
60
|
-
"directory": "<PROJECT_ROOT>/public",
|
|
61
|
-
"publicPath": [
|
|
62
|
-
"/",
|
|
63
|
-
],
|
|
64
|
-
"serveIndex": {
|
|
65
|
-
"icons": true,
|
|
66
|
-
},
|
|
67
|
-
"staticOptions": {},
|
|
68
|
-
"watch": {
|
|
69
|
-
"alwaysStat": true,
|
|
70
|
-
"atomic": false,
|
|
71
|
-
"followSymlinks": false,
|
|
72
|
-
"ignoreInitial": true,
|
|
73
|
-
"ignorePermissionErrors": true,
|
|
74
|
-
"ignored": undefined,
|
|
75
|
-
"interval": undefined,
|
|
76
|
-
"persistent": true,
|
|
77
|
-
"usePolling": false,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
],
|
|
81
|
-
"watchFiles": [],
|
|
82
|
-
"webSocketServer": {
|
|
83
|
-
"options": {
|
|
84
|
-
"path": "/ws",
|
|
85
|
-
},
|
|
86
|
-
"type": "ws",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
}
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
15
|
exports[`normalize options snapshot no options 1`] = `
|
|
93
16
|
{
|
|
94
17
|
"allowedHosts": "auto",
|
|
@@ -206,22 +129,40 @@ exports[`normalize options snapshot port string 1`] = `
|
|
|
206
129
|
exports[`normalize options snapshot react.development and react.refresh should be true in default when hot enabled 1`] = `
|
|
207
130
|
{
|
|
208
131
|
"builtins": {
|
|
209
|
-
"browserslist":
|
|
132
|
+
"browserslist": [],
|
|
133
|
+
"css": {
|
|
134
|
+
"modules": {
|
|
135
|
+
"exportsOnly": false,
|
|
136
|
+
"localIdentName": "[hash]",
|
|
137
|
+
"localsConvention": "asIs",
|
|
138
|
+
},
|
|
139
|
+
"presetEnv": [],
|
|
140
|
+
},
|
|
210
141
|
"decorator": {
|
|
211
142
|
"emitMetadata": true,
|
|
212
143
|
"legacy": true,
|
|
213
144
|
},
|
|
214
145
|
"define": {},
|
|
146
|
+
"devFriendlySplitChunks": false,
|
|
215
147
|
"emotion": undefined,
|
|
216
148
|
"html": [],
|
|
217
149
|
"minify": {
|
|
150
|
+
"dropConsole": false,
|
|
218
151
|
"enable": true,
|
|
219
152
|
"passes": 1,
|
|
153
|
+
"pureFuncs": [],
|
|
154
|
+
},
|
|
155
|
+
"noEmitAssets": false,
|
|
156
|
+
"polyfill": true,
|
|
157
|
+
"postcss": {
|
|
158
|
+
"pxtorem": undefined,
|
|
220
159
|
},
|
|
160
|
+
"progress": undefined,
|
|
221
161
|
"react": {
|
|
222
162
|
"development": true,
|
|
223
163
|
"refresh": true,
|
|
224
164
|
},
|
|
165
|
+
"treeShaking": true,
|
|
225
166
|
},
|
|
226
167
|
"devServer": {
|
|
227
168
|
"allowedHosts": "auto",
|
|
@@ -42,21 +42,7 @@ describe("normalize options snapshot", () => {
|
|
|
42
42
|
hot: true
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
const server = new RspackDevServer(compiler.options.devServer
|
|
46
|
-
await server.start();
|
|
47
|
-
expect({
|
|
48
|
-
builtins: compiler.options.builtins,
|
|
49
|
-
devServer: compiler.options.devServer
|
|
50
|
-
}).toMatchSnapshot();
|
|
51
|
-
await server.stop();
|
|
52
|
-
// should pointed to the same memory.
|
|
53
|
-
expect(compiler.options.devServer === server.options).toBeTruthy();
|
|
54
|
-
});
|
|
55
|
-
it("compier.options.devServer should be equal to server.options when devServer is undefined", async () => {
|
|
56
|
-
const compiler = createCompiler({
|
|
57
|
-
stats: "none"
|
|
58
|
-
});
|
|
59
|
-
const server = new RspackDevServer(compiler.options.devServer, compiler);
|
|
45
|
+
const server = new RspackDevServer(compiler.options.devServer!, compiler);
|
|
60
46
|
await server.start();
|
|
61
47
|
expect({
|
|
62
48
|
builtins: compiler.options.builtins,
|
|
@@ -80,7 +66,10 @@ async function match(config: RspackOptions) {
|
|
|
80
66
|
}
|
|
81
67
|
}
|
|
82
68
|
});
|
|
83
|
-
const server = new RspackDevServer(
|
|
69
|
+
const server = new RspackDevServer(
|
|
70
|
+
compiler.options.devServer ?? {},
|
|
71
|
+
compiler
|
|
72
|
+
);
|
|
84
73
|
await server.start();
|
|
85
74
|
expect(server.options).toMatchSnapshot();
|
|
86
75
|
await server.stop();
|
|
@@ -97,7 +86,10 @@ async function matchAdditionEntries(config: RspackOptions) {
|
|
|
97
86
|
}
|
|
98
87
|
}
|
|
99
88
|
});
|
|
100
|
-
const server = new RspackDevServer(
|
|
89
|
+
const server = new RspackDevServer(
|
|
90
|
+
compiler.options.devServer ?? {},
|
|
91
|
+
compiler
|
|
92
|
+
);
|
|
101
93
|
await server.start();
|
|
102
94
|
const entires = Object.entries(compiler.options.entry);
|
|
103
95
|
// some hack for snapshot
|