@umijs/bundler-utils 4.5.0 → 4.5.1
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/https.d.ts +1 -2
- package/dist/https.js +13 -2
- package/package.json +2 -2
package/dist/https.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { RequestListener } from 'http';
|
|
3
|
-
import spdy from 'spdy';
|
|
4
3
|
import { HttpsServerOptions } from './types';
|
|
5
4
|
export type { Server as SpdyServer } from 'spdy';
|
|
6
5
|
export declare function resolveHttpsConfig(httpsConfig: HttpsServerOptions): Promise<{
|
|
7
6
|
key: string;
|
|
8
7
|
cert: string;
|
|
9
8
|
}>;
|
|
10
|
-
export declare function createHttpsServer(app: RequestListener, httpsConfig: HttpsServerOptions): Promise<spdy.server.Server>;
|
|
9
|
+
export declare function createHttpsServer(app: RequestListener, httpsConfig: HttpsServerOptions): Promise<import("spdy").server.Server>;
|
package/dist/https.js
CHANGED
|
@@ -37,7 +37,6 @@ var import_utils = require("@umijs/utils");
|
|
|
37
37
|
var import_fs = require("fs");
|
|
38
38
|
var import_https = __toESM(require("https"));
|
|
39
39
|
var import_path = require("path");
|
|
40
|
-
var import_spdy = __toESM(require("spdy"));
|
|
41
40
|
var defaultHttpsHosts = [
|
|
42
41
|
"localhost",
|
|
43
42
|
"127.0.0.1"
|
|
@@ -108,7 +107,19 @@ function hasHostsChanged(jsonFile, hosts) {
|
|
|
108
107
|
async function createHttpsServer(app, httpsConfig) {
|
|
109
108
|
import_utils.logger.wait("[HTTPS] Starting service in https mode...");
|
|
110
109
|
const { key, cert } = await resolveHttpsConfig(httpsConfig);
|
|
111
|
-
|
|
110
|
+
let createServer;
|
|
111
|
+
if (httpsConfig.http2 === false) {
|
|
112
|
+
createServer = import_https.default.createServer;
|
|
113
|
+
} else {
|
|
114
|
+
try {
|
|
115
|
+
createServer = (await import("spdy")).createServer;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
import_utils.logger.error(
|
|
118
|
+
"[HTTPS] Error accrued when loading module spdy, maybe you should check your Node.js version, it requires Node.js < v24. See: https://github.com/spdy-http2/node-spdy/issues/397"
|
|
119
|
+
);
|
|
120
|
+
throw e;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
112
123
|
return createServer(
|
|
113
124
|
{
|
|
114
125
|
key: (0, import_fs.readFileSync)(key, "utf-8"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-utils",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/bundler-utils#readme",
|
|
5
5
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
6
6
|
"repository": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"regenerate": "^1.4.2",
|
|
20
20
|
"regenerate-unicode-properties": "10.1.1",
|
|
21
21
|
"spdy": "^4.0.2",
|
|
22
|
-
"@umijs/utils": "4.5.
|
|
22
|
+
"@umijs/utils": "4.5.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/code-frame": "7.23.5",
|