vite-ssg-optimized 0.24.2-optimized.20 → 0.24.2-optimized.22

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 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.79d27333.cjs');
7
+ const node = require('../shared/vite-ssg-optimized.3da368f4.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.22da6b90.mjs';
5
+ import { b as build } from '../shared/vite-ssg-optimized.5a003b5d.mjs';
6
6
  import 'node:module';
7
7
  import 'node:path';
8
8
  import '@unhead/ssr';
package/dist/node.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const node = require('./shared/vite-ssg-optimized.79d27333.cjs');
3
+ const node = require('./shared/vite-ssg-optimized.3da368f4.cjs');
4
4
  require('node:module');
5
5
  require('node:path');
6
6
  require('node:process');
package/dist/node.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { b as build } from './shared/vite-ssg-optimized.22da6b90.mjs';
1
+ export { b as build } from './shared/vite-ssg-optimized.5a003b5d.mjs';
2
2
  import 'node:module';
3
3
  import 'node:path';
4
4
  import 'node:process';
@@ -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.79d27333.cjs');
5
+ const node = require('./vite-ssg-optimized.3da368f4.cjs');
6
6
  const kolorist = require('kolorist');
7
7
  const vite = require('vite');
8
8
  require('node:path');
@@ -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.22da6b90.mjs';
3
+ import { g as getBeastiesOrCritters, e as executeTaskFn } from './vite-ssg-optimized.5a003b5d.mjs';
4
4
  import { gray, blue, red } from 'kolorist';
5
5
  import { resolveConfig } from 'vite';
6
6
  import 'node:path';
@@ -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.79d27333.cjs', document.baseURI).href)));
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.3da368f4.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,7 @@ 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.79d27333.cjs', document.baseURI).href))), {
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.3da368f4.cjs', document.baseURI).href))), {
1224
1224
  env: process__default.env,
1225
1225
  workerData: {
1226
1226
  workerId: index,
@@ -1278,8 +1278,18 @@ async function build(ssgOptions = {}, viteConfig = {}) {
1278
1278
  await queue.onSizeLessThan(concurrency);
1279
1279
  queue.add(async () => {
1280
1280
  const workerProxy = await selectWorker(workerIndex++ % numberOfWorkers);
1281
+ let retryCount = 0;
1282
+ const maxRetries = 3;
1281
1283
  const taskPromise = executeTaskInWorker(workerProxy, {
1282
1284
  route
1285
+ }).catch((e) => {
1286
+ if (retryCount++ < maxRetries) {
1287
+ console.log(`${kolorist.gray("[vite-ssg]")} ${kolorist.yellow(`Retrying ${retryCount} of ${maxRetries} for route: ${kolorist.cyan(route)}`)}`);
1288
+ return executeTaskInWorker(workerProxy, {
1289
+ route
1290
+ });
1291
+ }
1292
+ throw e;
1283
1293
  });
1284
1294
  const workerPromises = workersInUse.get(workerProxy) || [];
1285
1295
  workersInUse.set(workerProxy, workerPromises);
@@ -3,7 +3,7 @@ import { isAbsolute, join, parse, dirname } from 'node:path';
3
3
  import process$1 from 'node:process';
4
4
  import { renderSSRHead } from '@unhead/ssr';
5
5
  import fs from 'fs-extra';
6
- import { gray, yellow, blue, reset, green, dim, cyan, red } from 'kolorist';
6
+ import { gray, yellow, blue, reset, cyan, green, dim, red } from 'kolorist';
7
7
  import { resolveConfig, build as build$1, mergeConfig } from 'vite';
8
8
  import { s as serializeState } from './vite-ssg-optimized.579feabb.mjs';
9
9
  import html5Parser, { SyntaxKind } from 'html5parser';
@@ -1269,8 +1269,18 @@ async function build(ssgOptions = {}, viteConfig = {}) {
1269
1269
  await queue.onSizeLessThan(concurrency);
1270
1270
  queue.add(async () => {
1271
1271
  const workerProxy = await selectWorker(workerIndex++ % numberOfWorkers);
1272
+ let retryCount = 0;
1273
+ const maxRetries = 3;
1272
1274
  const taskPromise = executeTaskInWorker(workerProxy, {
1273
1275
  route
1276
+ }).catch((e) => {
1277
+ if (retryCount++ < maxRetries) {
1278
+ console.log(`${gray("[vite-ssg]")} ${yellow(`Retrying ${retryCount} of ${maxRetries} for route: ${cyan(route)}`)}`);
1279
+ return executeTaskInWorker(workerProxy, {
1280
+ route
1281
+ });
1282
+ }
1283
+ throw e;
1274
1284
  });
1275
1285
  const workerPromises = workersInUse.get(workerProxy) || [];
1276
1286
  workersInUse.set(workerProxy, workerPromises);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-ssg-optimized",
3
- "version": "0.24.2-optimized.20",
3
+ "version": "0.24.2-optimized.22",
4
4
  "description": "Server-side generation for Vite",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",