@modern-js/plugin-ssg 2.65.5 → 2.67.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.
@@ -77,14 +77,15 @@ function getHtml(url, port) {
77
77
  (0, import_http.request)(url, {
78
78
  headers
79
79
  }, (res) => {
80
- let html = "";
80
+ const chunks = [];
81
81
  res.on("error", (error) => {
82
82
  reject(error);
83
83
  });
84
84
  res.on("data", (chunk) => {
85
- html += chunk.toString();
85
+ chunks.push(chunk);
86
86
  });
87
87
  res.on("end", () => {
88
+ const html = Buffer.concat(chunks).toString();
88
89
  resolve(html);
89
90
  });
90
91
  }).end();
@@ -227,14 +227,15 @@ function getHtml(url, port) {
227
227
  request(url, {
228
228
  headers
229
229
  }, function(res) {
230
- var html = "";
230
+ var chunks = [];
231
231
  res.on("error", function(error) {
232
232
  reject(error);
233
233
  });
234
234
  res.on("data", function(chunk) {
235
- html += chunk.toString();
235
+ chunks.push(chunk);
236
236
  });
237
237
  res.on("end", function() {
238
+ var html = Buffer.concat(chunks).toString();
238
239
  resolve(html);
239
240
  });
240
241
  }).end();
@@ -54,14 +54,15 @@ function getHtml(url, port) {
54
54
  request(url, {
55
55
  headers
56
56
  }, (res) => {
57
- let html = "";
57
+ const chunks = [];
58
58
  res.on("error", (error) => {
59
59
  reject(error);
60
60
  });
61
61
  res.on("data", (chunk) => {
62
- html += chunk.toString();
62
+ chunks.push(chunk);
63
63
  });
64
64
  res.on("end", () => {
65
+ const html = Buffer.concat(chunks).toString();
65
66
  resolve(html);
66
67
  });
67
68
  }).end();
@@ -13,15 +13,15 @@ export declare const standardOptions: (ssgOptions: SSGConfig, entrypoints: Entry
13
13
  export declare const openRouteSSR: (routes: ModernRoute[], entries?: string[]) => {
14
14
  isSSR: boolean;
15
15
  bundle: string;
16
- entryName?: string | undefined;
16
+ entryName?: string;
17
17
  urlPath: string;
18
18
  entryPath: string;
19
- isSPA?: boolean | undefined;
20
- isRSC?: boolean | undefined;
21
- isStream?: boolean | undefined;
22
- isApi?: boolean | undefined;
23
- worker?: string | undefined;
24
- responseHeaders?: Record<string, unknown> | undefined;
19
+ isSPA?: boolean;
20
+ isRSC?: boolean;
21
+ isStream?: boolean;
22
+ isApi?: boolean;
23
+ worker?: string;
24
+ responseHeaders?: Record<string, unknown>;
25
25
  }[];
26
26
  export declare const flattenRoutes: (routes: AgreedRoute[]) => AgreedRoute[];
27
27
  export declare function chunkArray<T>(arr: T[], size: number): T[][];
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { IncomingMessage, ServerResponse } from 'http';
3
2
  export type Options = {
4
3
  url: string;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.65.5",
18
+ "version": "2.67.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -63,8 +63,8 @@
63
63
  "node-mocks-http": "^1.11.0",
64
64
  "normalize-path": "3.0.0",
65
65
  "portfinder": "^1.0.28",
66
- "@modern-js/prod-server": "2.65.5",
67
- "@modern-js/utils": "2.65.5"
66
+ "@modern-js/prod-server": "2.67.0",
67
+ "@modern-js/utils": "2.67.0"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react-router-dom": ">=5.1.2"
@@ -82,10 +82,10 @@
82
82
  "react-dom": "^18.3.1",
83
83
  "react-router-dom": "6.27.0",
84
84
  "typescript": "^5",
85
- "@modern-js/app-tools": "2.65.5",
86
- "@modern-js/types": "2.65.5",
87
- "@scripts/build": "2.65.5",
88
- "@scripts/jest-config": "2.65.5"
85
+ "@modern-js/app-tools": "2.67.0",
86
+ "@scripts/jest-config": "2.66.0",
87
+ "@modern-js/types": "2.67.0",
88
+ "@scripts/build": "2.66.0"
89
89
  },
90
90
  "sideEffects": false,
91
91
  "publishConfig": {