vite-ssg-optimized 0.24.2-optimized.4 → 0.24.2-optimized.6
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/node/cli.cjs +1 -1
- package/dist/node/cli.mjs +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +1 -1
- package/dist/shared/build.worker.cjs +4 -2
- package/dist/shared/build.worker.mjs +4 -2
- package/dist/shared/{vite-ssg-optimized.df7366ff.cjs → vite-ssg-optimized.0e1ccf0d.cjs} +16 -7
- package/dist/shared/{vite-ssg-optimized.c92f06ae.mjs → vite-ssg-optimized.47495f26.mjs} +14 -5
- package/package.json +1 -1
package/dist/node/cli.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const process = require('node:process');
|
|
|
4
4
|
const kolorist = require('kolorist');
|
|
5
5
|
const yargs = require('yargs');
|
|
6
6
|
const helpers = require('yargs/helpers');
|
|
7
|
-
const node = require('../shared/vite-ssg-optimized.
|
|
7
|
+
const node = require('../shared/vite-ssg-optimized.0e1ccf0d.cjs');
|
|
8
8
|
require('node:module');
|
|
9
9
|
require('node:path');
|
|
10
10
|
require('@unhead/ssr');
|
package/dist/node/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import process from 'node:process';
|
|
|
2
2
|
import { gray, bold, red, reset, underline } from 'kolorist';
|
|
3
3
|
import yargs from 'yargs';
|
|
4
4
|
import { hideBin } from 'yargs/helpers';
|
|
5
|
-
import { b as build } from '../shared/vite-ssg-optimized.
|
|
5
|
+
import { b as build } from '../shared/vite-ssg-optimized.47495f26.mjs';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import '@unhead/ssr';
|
package/dist/node.cjs
CHANGED
package/dist/node.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const node_module = require('node:module');
|
|
4
4
|
const node_worker_threads = require('node:worker_threads');
|
|
5
|
-
const node = require('./vite-ssg-optimized.
|
|
5
|
+
const node = require('./vite-ssg-optimized.0e1ccf0d.cjs');
|
|
6
6
|
const kolorist = require('kolorist');
|
|
7
7
|
const vite = require('vite');
|
|
8
8
|
require('node:path');
|
|
@@ -73,7 +73,9 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
73
73
|
}
|
|
74
74
|
node_worker_threads.parentPort.postMessage({ type: "result", id, result });
|
|
75
75
|
} catch (e) {
|
|
76
|
-
|
|
76
|
+
const message2 = e.message;
|
|
77
|
+
const stack = e.stack || "";
|
|
78
|
+
node_worker_threads.parentPort.postMessage({ type: "error", id, error: { message: message2, stack } });
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { parentPort, workerData } from 'node:worker_threads';
|
|
3
|
-
import { g as getBeastiesOrCritters, e as executeTaskFn } from './vite-ssg-optimized.
|
|
3
|
+
import { g as getBeastiesOrCritters, e as executeTaskFn } from './vite-ssg-optimized.47495f26.mjs';
|
|
4
4
|
import { gray, blue } from 'kolorist';
|
|
5
5
|
import { resolveConfig } from 'vite';
|
|
6
6
|
import 'node:path';
|
|
@@ -70,7 +70,9 @@ import 'html5parser';
|
|
|
70
70
|
}
|
|
71
71
|
parentPort.postMessage({ type: "result", id, result });
|
|
72
72
|
} catch (e) {
|
|
73
|
-
|
|
73
|
+
const message2 = e.message;
|
|
74
|
+
const stack = e.stack || "";
|
|
75
|
+
parentPort.postMessage({ type: "error", id, error: { message: message2, stack } });
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
});
|
|
@@ -1160,12 +1160,12 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1160
1160
|
ssgOut: _ssgOutDir = node_path.join(root, ".vite-ssg-temp", Math.random().toString(36).substring(2, 12)),
|
|
1161
1161
|
formatting = "none",
|
|
1162
1162
|
minifyOptions = {},
|
|
1163
|
-
crittersOptions = {},
|
|
1163
|
+
// crittersOptions = {},
|
|
1164
1164
|
beastiesOptions = {},
|
|
1165
1165
|
includedRoutes: configIncludedRoutes = DefaultIncludedRoutes,
|
|
1166
|
-
onBeforePageRender,
|
|
1167
|
-
onPageRendered,
|
|
1168
|
-
onDonePageRender,
|
|
1166
|
+
// onBeforePageRender,
|
|
1167
|
+
// onPageRendered,
|
|
1168
|
+
// onDonePageRender,
|
|
1169
1169
|
onFinished,
|
|
1170
1170
|
dirStyle = "flat",
|
|
1171
1171
|
includeAllRoutes = false,
|
|
@@ -1193,7 +1193,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1193
1193
|
const prefix = format === "esm" && process__default.platform === "win32" ? "file://" : "";
|
|
1194
1194
|
const ext = format === "esm" ? ".mjs" : ".cjs";
|
|
1195
1195
|
const serverEntry = prefix + node_path.join(ssgOut, node_path.parse(ssrEntry).name + ext).replace(/\\/g, "/");
|
|
1196
|
-
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-ssg-optimized.
|
|
1196
|
+
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-ssg-optimized.0e1ccf0d.cjs', document.baseURI).href)));
|
|
1197
1197
|
const { createApp, includedRoutes: serverEntryIncludedRoutes } = format === "esm" ? await import(serverEntry) : _require(serverEntry);
|
|
1198
1198
|
const includedRoutes = serverEntryIncludedRoutes || configIncludedRoutes;
|
|
1199
1199
|
const { routes } = await createApp(false);
|
|
@@ -1220,7 +1220,8 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1220
1220
|
const queue = new PQueue({ concurrency });
|
|
1221
1221
|
const workerExt = format === "esm" ? ".mjs" : ".cjs";
|
|
1222
1222
|
const createProxy = (index) => {
|
|
1223
|
-
const workerProxy = new BuildWorkerProxy(new URL(`./build.worker${workerExt}`, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-ssg-optimized.
|
|
1223
|
+
const workerProxy = new BuildWorkerProxy(new URL(`./build.worker${workerExt}`, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/vite-ssg-optimized.0e1ccf0d.cjs', document.baseURI).href))), {
|
|
1224
|
+
env: process__default.env,
|
|
1224
1225
|
workerData: {
|
|
1225
1226
|
workerId: index,
|
|
1226
1227
|
serverEntry,
|
|
@@ -1242,6 +1243,14 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1242
1243
|
};
|
|
1243
1244
|
const numberOfWorkers = 5;
|
|
1244
1245
|
const workers = Array.from({ length: numberOfWorkers }, (_, index) => createProxy(index));
|
|
1246
|
+
const terminateWorkers = () => {
|
|
1247
|
+
workers.splice(0, workers.length).forEach((worker) => worker.terminate());
|
|
1248
|
+
};
|
|
1249
|
+
process__default.on("SIGINT", terminateWorkers);
|
|
1250
|
+
process__default.on("SIGTERM", terminateWorkers);
|
|
1251
|
+
process__default.on("SIGBREAK", terminateWorkers);
|
|
1252
|
+
process__default.on("beforeExit", terminateWorkers);
|
|
1253
|
+
process__default.on("exit", terminateWorkers);
|
|
1245
1254
|
let workerIndex = 0;
|
|
1246
1255
|
for (const route of routesPaths) {
|
|
1247
1256
|
await queue.onSizeLessThan(concurrency + 5);
|
|
@@ -1255,7 +1264,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1255
1264
|
});
|
|
1256
1265
|
}
|
|
1257
1266
|
await queue.start().onIdle();
|
|
1258
|
-
|
|
1267
|
+
terminateWorkers();
|
|
1259
1268
|
if (!ssgOptions["skip-build"]) {
|
|
1260
1269
|
await fs__default.remove(ssgOut);
|
|
1261
1270
|
}
|
|
@@ -1151,12 +1151,12 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1151
1151
|
ssgOut: _ssgOutDir = join(root, ".vite-ssg-temp", Math.random().toString(36).substring(2, 12)),
|
|
1152
1152
|
formatting = "none",
|
|
1153
1153
|
minifyOptions = {},
|
|
1154
|
-
crittersOptions = {},
|
|
1154
|
+
// crittersOptions = {},
|
|
1155
1155
|
beastiesOptions = {},
|
|
1156
1156
|
includedRoutes: configIncludedRoutes = DefaultIncludedRoutes,
|
|
1157
|
-
onBeforePageRender,
|
|
1158
|
-
onPageRendered,
|
|
1159
|
-
onDonePageRender,
|
|
1157
|
+
// onBeforePageRender,
|
|
1158
|
+
// onPageRendered,
|
|
1159
|
+
// onDonePageRender,
|
|
1160
1160
|
onFinished,
|
|
1161
1161
|
dirStyle = "flat",
|
|
1162
1162
|
includeAllRoutes = false,
|
|
@@ -1212,6 +1212,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1212
1212
|
const workerExt = format === "esm" ? ".mjs" : ".cjs";
|
|
1213
1213
|
const createProxy = (index) => {
|
|
1214
1214
|
const workerProxy = new BuildWorkerProxy(new URL(`./build.worker${workerExt}`, import.meta.url), {
|
|
1215
|
+
env: process$1.env,
|
|
1215
1216
|
workerData: {
|
|
1216
1217
|
workerId: index,
|
|
1217
1218
|
serverEntry,
|
|
@@ -1233,6 +1234,14 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1233
1234
|
};
|
|
1234
1235
|
const numberOfWorkers = 5;
|
|
1235
1236
|
const workers = Array.from({ length: numberOfWorkers }, (_, index) => createProxy(index));
|
|
1237
|
+
const terminateWorkers = () => {
|
|
1238
|
+
workers.splice(0, workers.length).forEach((worker) => worker.terminate());
|
|
1239
|
+
};
|
|
1240
|
+
process$1.on("SIGINT", terminateWorkers);
|
|
1241
|
+
process$1.on("SIGTERM", terminateWorkers);
|
|
1242
|
+
process$1.on("SIGBREAK", terminateWorkers);
|
|
1243
|
+
process$1.on("beforeExit", terminateWorkers);
|
|
1244
|
+
process$1.on("exit", terminateWorkers);
|
|
1236
1245
|
let workerIndex = 0;
|
|
1237
1246
|
for (const route of routesPaths) {
|
|
1238
1247
|
await queue.onSizeLessThan(concurrency + 5);
|
|
@@ -1246,7 +1255,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1246
1255
|
});
|
|
1247
1256
|
}
|
|
1248
1257
|
await queue.start().onIdle();
|
|
1249
|
-
|
|
1258
|
+
terminateWorkers();
|
|
1250
1259
|
if (!ssgOptions["skip-build"]) {
|
|
1251
1260
|
await fs.remove(ssgOut);
|
|
1252
1261
|
}
|