@rspack/dev-server 0.0.0-20230216082502 → 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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# rspack-dev-server
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20230220035042
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
- Updated dependencies [b694d4a58]
|
|
23
23
|
- Updated dependencies [60fb4c5bf]
|
|
24
24
|
- Updated dependencies [c1f19b817]
|
|
25
|
-
- @rspack/core@0.0.0-
|
|
26
|
-
- @rspack/dev-client@0.0.0-
|
|
27
|
-
- @rspack/dev-middleware@0.0.0-
|
|
28
|
-
- @rspack/dev-server@0.0.0-
|
|
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
|
|
29
29
|
|
|
30
30
|
## 0.0.22
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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": "",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@types/connect-history-api-fallback": "1.3.5",
|
|
15
15
|
"fs-extra": "11.1.0",
|
|
16
16
|
"puppeteer": "19.4.0",
|
|
17
|
-
"@rspack/core": "0.0.0-
|
|
17
|
+
"@rspack/core": "0.0.0-20230220035042"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"express": "4.18.1",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"webpack-dev-server": "4.11.1",
|
|
24
24
|
"connect-history-api-fallback": "2.0.0",
|
|
25
25
|
"http-proxy-middleware": "2.0.6",
|
|
26
|
-
"@rspack/dev-
|
|
27
|
-
"@rspack/dev-
|
|
28
|
-
"@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"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@rspack/core": "0.0.0-
|
|
31
|
+
"@rspack/core": "0.0.0-20230220035042"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "rm -rf dist/ && tsc",
|
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
|
+
}
|
|
@@ -129,22 +129,40 @@ exports[`normalize options snapshot port string 1`] = `
|
|
|
129
129
|
exports[`normalize options snapshot react.development and react.refresh should be true in default when hot enabled 1`] = `
|
|
130
130
|
{
|
|
131
131
|
"builtins": {
|
|
132
|
-
"browserslist":
|
|
132
|
+
"browserslist": [],
|
|
133
|
+
"css": {
|
|
134
|
+
"modules": {
|
|
135
|
+
"exportsOnly": false,
|
|
136
|
+
"localIdentName": "[hash]",
|
|
137
|
+
"localsConvention": "asIs",
|
|
138
|
+
},
|
|
139
|
+
"presetEnv": [],
|
|
140
|
+
},
|
|
133
141
|
"decorator": {
|
|
134
142
|
"emitMetadata": true,
|
|
135
143
|
"legacy": true,
|
|
136
144
|
},
|
|
137
145
|
"define": {},
|
|
146
|
+
"devFriendlySplitChunks": false,
|
|
138
147
|
"emotion": undefined,
|
|
139
148
|
"html": [],
|
|
140
149
|
"minify": {
|
|
150
|
+
"dropConsole": false,
|
|
141
151
|
"enable": true,
|
|
142
152
|
"passes": 1,
|
|
153
|
+
"pureFuncs": [],
|
|
154
|
+
},
|
|
155
|
+
"noEmitAssets": false,
|
|
156
|
+
"polyfill": true,
|
|
157
|
+
"postcss": {
|
|
158
|
+
"pxtorem": undefined,
|
|
143
159
|
},
|
|
160
|
+
"progress": undefined,
|
|
144
161
|
"react": {
|
|
145
162
|
"development": true,
|
|
146
163
|
"refresh": true,
|
|
147
164
|
},
|
|
165
|
+
"treeShaking": true,
|
|
148
166
|
},
|
|
149
167
|
"devServer": {
|
|
150
168
|
"allowedHosts": "auto",
|