vite-ssg-optimized 0.24.2-optimized.18 → 0.24.2-optimized.2
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/client/single-page.d.cts +2 -2
- package/dist/client/single-page.d.mts +2 -2
- package/dist/client/single-page.d.ts +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/node/cli.cjs +1 -1
- package/dist/node/cli.mjs +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +2 -2
- package/dist/node.d.mts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.mjs +1 -1
- package/dist/shared/build.worker.cjs +8 -47
- package/dist/shared/build.worker.d.cts +3 -4
- package/dist/shared/build.worker.d.mts +3 -4
- package/dist/shared/build.worker.d.ts +3 -4
- package/dist/shared/build.worker.mjs +9 -48
- package/dist/shared/{vite-ssg-optimized.f03a17e6.d.mts → vite-ssg-optimized.12fd9d22.d.cts} +1 -1
- package/dist/shared/{vite-ssg-optimized.06215e82.cjs → vite-ssg-optimized.31f4c9de.cjs} +21 -54
- package/dist/shared/{vite-ssg-optimized.27bed688.d.cts → vite-ssg-optimized.892682c8.d.mts} +1 -1
- package/dist/shared/{vite-ssg-optimized.f1a9229c.d.ts → vite-ssg-optimized.950926bc.d.ts} +1 -1
- package/dist/shared/{vite-ssg-optimized.341e382e.d.ts → vite-ssg-optimized.cf5cb4ee.d.cts} +1 -6
- package/dist/shared/{vite-ssg-optimized.341e382e.d.cts → vite-ssg-optimized.cf5cb4ee.d.mts} +1 -6
- package/dist/shared/{vite-ssg-optimized.341e382e.d.mts → vite-ssg-optimized.cf5cb4ee.d.ts} +1 -6
- package/dist/shared/{vite-ssg-optimized.fd5dd0cb.mjs → vite-ssg-optimized.dc2a4a38.mjs} +20 -53
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { V as ViteSSGContext, a as ViteSSGClientOptions } from '../shared/vite-ssg-optimized.
|
|
3
|
-
export { R as RouterOptions, b as ViteSSGOptions } from '../shared/vite-ssg-optimized.
|
|
2
|
+
import { V as ViteSSGContext, a as ViteSSGClientOptions } from '../shared/vite-ssg-optimized.cf5cb4ee.cjs';
|
|
3
|
+
export { R as RouterOptions, b as ViteSSGOptions } from '../shared/vite-ssg-optimized.cf5cb4ee.cjs';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { V as ViteSSGContext, a as ViteSSGClientOptions } from '../shared/vite-ssg-optimized.
|
|
3
|
-
export { R as RouterOptions, b as ViteSSGOptions } from '../shared/vite-ssg-optimized.
|
|
2
|
+
import { V as ViteSSGContext, a as ViteSSGClientOptions } from '../shared/vite-ssg-optimized.cf5cb4ee.mjs';
|
|
3
|
+
export { R as RouterOptions, b as ViteSSGOptions } from '../shared/vite-ssg-optimized.cf5cb4ee.mjs';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { V as ViteSSGContext, a as ViteSSGClientOptions } from '../shared/vite-ssg-optimized.
|
|
3
|
-
export { R as RouterOptions, b as ViteSSGOptions } from '../shared/vite-ssg-optimized.
|
|
2
|
+
import { V as ViteSSGContext, a as ViteSSGClientOptions } from '../shared/vite-ssg-optimized.cf5cb4ee.js';
|
|
3
|
+
export { R as RouterOptions, b as ViteSSGOptions } from '../shared/vite-ssg-optimized.cf5cb4ee.js';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { R as RouterOptions, V as ViteSSGContext, a as ViteSSGClientOptions } from './shared/vite-ssg-optimized.
|
|
3
|
-
export { b as ViteSSGOptions } from './shared/vite-ssg-optimized.
|
|
2
|
+
import { R as RouterOptions, V as ViteSSGContext, a as ViteSSGClientOptions } from './shared/vite-ssg-optimized.cf5cb4ee.cjs';
|
|
3
|
+
export { b as ViteSSGOptions } from './shared/vite-ssg-optimized.cf5cb4ee.cjs';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { R as RouterOptions, V as ViteSSGContext, a as ViteSSGClientOptions } from './shared/vite-ssg-optimized.
|
|
3
|
-
export { b as ViteSSGOptions } from './shared/vite-ssg-optimized.
|
|
2
|
+
import { R as RouterOptions, V as ViteSSGContext, a as ViteSSGClientOptions } from './shared/vite-ssg-optimized.cf5cb4ee.mjs';
|
|
3
|
+
export { b as ViteSSGOptions } from './shared/vite-ssg-optimized.cf5cb4ee.mjs';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { R as RouterOptions, V as ViteSSGContext, a as ViteSSGClientOptions } from './shared/vite-ssg-optimized.
|
|
3
|
-
export { b as ViteSSGOptions } from './shared/vite-ssg-optimized.
|
|
2
|
+
import { R as RouterOptions, V as ViteSSGContext, a as ViteSSGClientOptions } from './shared/vite-ssg-optimized.cf5cb4ee.js';
|
|
3
|
+
export { b as ViteSSGOptions } from './shared/vite-ssg-optimized.cf5cb4ee.js';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
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.31f4c9de.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.dc2a4a38.mjs';
|
|
6
6
|
import 'node:module';
|
|
7
7
|
import 'node:path';
|
|
8
8
|
import '@unhead/ssr';
|
package/dist/node.cjs
CHANGED
package/dist/node.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { b as build } from './shared/vite-ssg-optimized.
|
|
1
|
+
export { b as build } from './shared/vite-ssg-optimized.12fd9d22.cjs';
|
|
2
2
|
import 'vite';
|
|
3
|
-
import './shared/vite-ssg-optimized.
|
|
3
|
+
import './shared/vite-ssg-optimized.cf5cb4ee.cjs';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
package/dist/node.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { b as build } from './shared/vite-ssg-optimized.
|
|
1
|
+
export { b as build } from './shared/vite-ssg-optimized.892682c8.mjs';
|
|
2
2
|
import 'vite';
|
|
3
|
-
import './shared/vite-ssg-optimized.
|
|
3
|
+
import './shared/vite-ssg-optimized.cf5cb4ee.mjs';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { b as build } from './shared/vite-ssg-optimized.
|
|
1
|
+
export { b as build } from './shared/vite-ssg-optimized.950926bc.js';
|
|
2
2
|
import 'vite';
|
|
3
|
-
import './shared/vite-ssg-optimized.
|
|
3
|
+
import './shared/vite-ssg-optimized.cf5cb4ee.js';
|
|
4
4
|
import '@unhead/vue';
|
|
5
5
|
import 'beasties';
|
|
6
6
|
import 'critters';
|
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.31f4c9de.cjs');
|
|
6
6
|
const kolorist = require('kolorist');
|
|
7
7
|
const vite = require('vite');
|
|
8
8
|
require('node:path');
|
|
@@ -14,50 +14,13 @@ require('html5parser');
|
|
|
14
14
|
|
|
15
15
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
16
16
|
(async () => {
|
|
17
|
-
const plainnify = (m) => {
|
|
18
|
-
if (m instanceof Function) {
|
|
19
|
-
return void 0;
|
|
20
|
-
}
|
|
21
|
-
if (Array.isArray(m)) {
|
|
22
|
-
return m.map(plainnify);
|
|
23
|
-
}
|
|
24
|
-
if (typeof m === "object" && m !== null) {
|
|
25
|
-
if (m instanceof Error || "stack" in m) {
|
|
26
|
-
return {
|
|
27
|
-
message: m.message,
|
|
28
|
-
stack: m.stack
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
return Object.entries(m).reduce((acc, [key, value]) => {
|
|
32
|
-
acc[key] = plainnify(value);
|
|
33
|
-
return acc;
|
|
34
|
-
}, {});
|
|
35
|
-
}
|
|
36
|
-
return m?.toString();
|
|
37
|
-
};
|
|
38
|
-
const fnLog = (level = "info", ...msg) => {
|
|
39
|
-
const newMsg = msg.map(plainnify);
|
|
40
|
-
if (level === "error") {
|
|
41
|
-
process.stderr.write(`${kolorist.yellow("[vite-ssg-worker-console]")} ${JSON.stringify(newMsg)}
|
|
42
|
-
`);
|
|
43
|
-
}
|
|
44
|
-
node_worker_threads.parentPort.postMessage({ type: "log", args: newMsg, level });
|
|
45
|
-
};
|
|
46
|
-
globalThis.console = Object.assign(globalThis.console, {
|
|
47
|
-
info: fnLog.bind(globalThis.console, "info"),
|
|
48
|
-
warn: fnLog.bind(globalThis.console, "warn"),
|
|
49
|
-
error: fnLog.bind(globalThis.console, "error"),
|
|
50
|
-
log: fnLog.bind(globalThis.console, "log"),
|
|
51
|
-
trace: fnLog.bind(globalThis.console, "trace"),
|
|
52
|
-
debug: fnLog.bind(globalThis.console, "debug")
|
|
53
|
-
});
|
|
54
17
|
const { serverEntry, out, beastiesOptions, viteConfig, mode, format, dirStyle, ...extraOpts } = node_worker_threads.workerData;
|
|
55
18
|
const nodeEnv = process.env.NODE_ENV || "production";
|
|
56
19
|
const config = await vite.resolveConfig(viteConfig, "build", mode, nodeEnv);
|
|
57
20
|
const {
|
|
58
21
|
onPageRendered,
|
|
59
|
-
onBeforePageRender
|
|
60
|
-
|
|
22
|
+
onBeforePageRender,
|
|
23
|
+
onDonePageRender
|
|
61
24
|
} = config.ssgOptions || {};
|
|
62
25
|
const { renderToString } = await import('vue/server-renderer');
|
|
63
26
|
const outDir = out.replace(process.cwd(), "").replace(/^\//g, "");
|
|
@@ -76,9 +39,10 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
76
39
|
renderToString,
|
|
77
40
|
onPageRendered,
|
|
78
41
|
onBeforePageRender,
|
|
79
|
-
|
|
42
|
+
onDonePageRender,
|
|
80
43
|
beasties,
|
|
81
44
|
config: { logger: { info: (msg) => {
|
|
45
|
+
config.logger?.info?.(msg);
|
|
82
46
|
node_worker_threads.parentPort.postMessage({ type: "log", args: [msg] });
|
|
83
47
|
} } },
|
|
84
48
|
...opts
|
|
@@ -91,6 +55,7 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
91
55
|
if (type in execMap) {
|
|
92
56
|
node_worker_threads.parentPort.postMessage(`running ${type}`);
|
|
93
57
|
try {
|
|
58
|
+
process.stdout.write(JSON.stringify(args));
|
|
94
59
|
const result = await execMap[type](...args ?? []);
|
|
95
60
|
if (result.appCtx) {
|
|
96
61
|
Object.assign(result, {
|
|
@@ -99,12 +64,8 @@ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentS
|
|
|
99
64
|
}
|
|
100
65
|
node_worker_threads.parentPort.postMessage({ type: "result", id, result });
|
|
101
66
|
} catch (e) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const error = { message: message2, stack };
|
|
105
|
-
process.stderr.write(`${kolorist.red("[vite-ssg-worker]")} ${message2} ${stack}
|
|
106
|
-
`);
|
|
107
|
-
node_worker_threads.parentPort.postMessage({ type: "error", id, error });
|
|
67
|
+
process.stdout.write(JSON.stringify(e));
|
|
68
|
+
node_worker_threads.parentPort.postMessage({ type: "error", id, error: e.toString() });
|
|
108
69
|
}
|
|
109
70
|
}
|
|
110
71
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { M as Manifest } from './vite-ssg-optimized.
|
|
1
|
+
import { M as Manifest } from './vite-ssg-optimized.12fd9d22.cjs';
|
|
2
2
|
import { ViteSSGOptions } from 'vite-ssg';
|
|
3
3
|
import { Options } from 'beasties';
|
|
4
4
|
import { Options as Options$1 } from 'html-minifier-terser';
|
|
5
5
|
import 'vite';
|
|
6
|
-
import './vite-ssg-optimized.
|
|
6
|
+
import './vite-ssg-optimized.cf5cb4ee.cjs';
|
|
7
7
|
import '@unhead/vue';
|
|
8
8
|
import 'critters';
|
|
9
9
|
import 'vue';
|
|
@@ -11,7 +11,6 @@ import 'vue-router';
|
|
|
11
11
|
|
|
12
12
|
interface WorkerDataEntry {
|
|
13
13
|
serverEntry: string;
|
|
14
|
-
workerId: number | string;
|
|
15
14
|
format: 'esm' | 'cjs';
|
|
16
15
|
out: string;
|
|
17
16
|
dirStyle: ViteSSGOptions['dirStyle'];
|
|
@@ -23,7 +22,7 @@ interface WorkerDataEntry {
|
|
|
23
22
|
formatting: ViteSSGOptions['formatting'];
|
|
24
23
|
minifyOptions: Options$1;
|
|
25
24
|
viteConfig: {
|
|
26
|
-
configFile
|
|
25
|
+
configFile: string;
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { M as Manifest } from './vite-ssg-optimized.
|
|
1
|
+
import { M as Manifest } from './vite-ssg-optimized.892682c8.mjs';
|
|
2
2
|
import { ViteSSGOptions } from 'vite-ssg';
|
|
3
3
|
import { Options } from 'beasties';
|
|
4
4
|
import { Options as Options$1 } from 'html-minifier-terser';
|
|
5
5
|
import 'vite';
|
|
6
|
-
import './vite-ssg-optimized.
|
|
6
|
+
import './vite-ssg-optimized.cf5cb4ee.mjs';
|
|
7
7
|
import '@unhead/vue';
|
|
8
8
|
import 'critters';
|
|
9
9
|
import 'vue';
|
|
@@ -11,7 +11,6 @@ import 'vue-router';
|
|
|
11
11
|
|
|
12
12
|
interface WorkerDataEntry {
|
|
13
13
|
serverEntry: string;
|
|
14
|
-
workerId: number | string;
|
|
15
14
|
format: 'esm' | 'cjs';
|
|
16
15
|
out: string;
|
|
17
16
|
dirStyle: ViteSSGOptions['dirStyle'];
|
|
@@ -23,7 +22,7 @@ interface WorkerDataEntry {
|
|
|
23
22
|
formatting: ViteSSGOptions['formatting'];
|
|
24
23
|
minifyOptions: Options$1;
|
|
25
24
|
viteConfig: {
|
|
26
|
-
configFile
|
|
25
|
+
configFile: string;
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { M as Manifest } from './vite-ssg-optimized.
|
|
1
|
+
import { M as Manifest } from './vite-ssg-optimized.950926bc.js';
|
|
2
2
|
import { ViteSSGOptions } from 'vite-ssg';
|
|
3
3
|
import { Options } from 'beasties';
|
|
4
4
|
import { Options as Options$1 } from 'html-minifier-terser';
|
|
5
5
|
import 'vite';
|
|
6
|
-
import './vite-ssg-optimized.
|
|
6
|
+
import './vite-ssg-optimized.cf5cb4ee.js';
|
|
7
7
|
import '@unhead/vue';
|
|
8
8
|
import 'critters';
|
|
9
9
|
import 'vue';
|
|
@@ -11,7 +11,6 @@ import 'vue-router';
|
|
|
11
11
|
|
|
12
12
|
interface WorkerDataEntry {
|
|
13
13
|
serverEntry: string;
|
|
14
|
-
workerId: number | string;
|
|
15
14
|
format: 'esm' | 'cjs';
|
|
16
15
|
out: string;
|
|
17
16
|
dirStyle: ViteSSGOptions['dirStyle'];
|
|
@@ -23,7 +22,7 @@ interface WorkerDataEntry {
|
|
|
23
22
|
formatting: ViteSSGOptions['formatting'];
|
|
24
23
|
minifyOptions: Options$1;
|
|
25
24
|
viteConfig: {
|
|
26
|
-
configFile
|
|
25
|
+
configFile: string;
|
|
27
26
|
};
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -1,7 +1,7 @@
|
|
|
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.
|
|
4
|
-
import { gray, blue
|
|
3
|
+
import { g as getBeastiesOrCritters, e as executeTaskFn } from './vite-ssg-optimized.dc2a4a38.mjs';
|
|
4
|
+
import { gray, blue } from 'kolorist';
|
|
5
5
|
import { resolveConfig } from 'vite';
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'node:process';
|
|
@@ -11,50 +11,13 @@ import './vite-ssg-optimized.579feabb.mjs';
|
|
|
11
11
|
import 'html5parser';
|
|
12
12
|
|
|
13
13
|
(async () => {
|
|
14
|
-
const plainnify = (m) => {
|
|
15
|
-
if (m instanceof Function) {
|
|
16
|
-
return void 0;
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(m)) {
|
|
19
|
-
return m.map(plainnify);
|
|
20
|
-
}
|
|
21
|
-
if (typeof m === "object" && m !== null) {
|
|
22
|
-
if (m instanceof Error || "stack" in m) {
|
|
23
|
-
return {
|
|
24
|
-
message: m.message,
|
|
25
|
-
stack: m.stack
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
return Object.entries(m).reduce((acc, [key, value]) => {
|
|
29
|
-
acc[key] = plainnify(value);
|
|
30
|
-
return acc;
|
|
31
|
-
}, {});
|
|
32
|
-
}
|
|
33
|
-
return m?.toString();
|
|
34
|
-
};
|
|
35
|
-
const fnLog = (level = "info", ...msg) => {
|
|
36
|
-
const newMsg = msg.map(plainnify);
|
|
37
|
-
if (level === "error") {
|
|
38
|
-
process.stderr.write(`${yellow("[vite-ssg-worker-console]")} ${JSON.stringify(newMsg)}
|
|
39
|
-
`);
|
|
40
|
-
}
|
|
41
|
-
parentPort.postMessage({ type: "log", args: newMsg, level });
|
|
42
|
-
};
|
|
43
|
-
globalThis.console = Object.assign(globalThis.console, {
|
|
44
|
-
info: fnLog.bind(globalThis.console, "info"),
|
|
45
|
-
warn: fnLog.bind(globalThis.console, "warn"),
|
|
46
|
-
error: fnLog.bind(globalThis.console, "error"),
|
|
47
|
-
log: fnLog.bind(globalThis.console, "log"),
|
|
48
|
-
trace: fnLog.bind(globalThis.console, "trace"),
|
|
49
|
-
debug: fnLog.bind(globalThis.console, "debug")
|
|
50
|
-
});
|
|
51
14
|
const { serverEntry, out, beastiesOptions, viteConfig, mode, format, dirStyle, ...extraOpts } = workerData;
|
|
52
15
|
const nodeEnv = process.env.NODE_ENV || "production";
|
|
53
16
|
const config = await resolveConfig(viteConfig, "build", mode, nodeEnv);
|
|
54
17
|
const {
|
|
55
18
|
onPageRendered,
|
|
56
|
-
onBeforePageRender
|
|
57
|
-
|
|
19
|
+
onBeforePageRender,
|
|
20
|
+
onDonePageRender
|
|
58
21
|
} = config.ssgOptions || {};
|
|
59
22
|
const { renderToString } = await import('vue/server-renderer');
|
|
60
23
|
const outDir = out.replace(process.cwd(), "").replace(/^\//g, "");
|
|
@@ -73,9 +36,10 @@ import 'html5parser';
|
|
|
73
36
|
renderToString,
|
|
74
37
|
onPageRendered,
|
|
75
38
|
onBeforePageRender,
|
|
76
|
-
|
|
39
|
+
onDonePageRender,
|
|
77
40
|
beasties,
|
|
78
41
|
config: { logger: { info: (msg) => {
|
|
42
|
+
config.logger?.info?.(msg);
|
|
79
43
|
parentPort.postMessage({ type: "log", args: [msg] });
|
|
80
44
|
} } },
|
|
81
45
|
...opts
|
|
@@ -88,6 +52,7 @@ import 'html5parser';
|
|
|
88
52
|
if (type in execMap) {
|
|
89
53
|
parentPort.postMessage(`running ${type}`);
|
|
90
54
|
try {
|
|
55
|
+
process.stdout.write(JSON.stringify(args));
|
|
91
56
|
const result = await execMap[type](...args ?? []);
|
|
92
57
|
if (result.appCtx) {
|
|
93
58
|
Object.assign(result, {
|
|
@@ -96,12 +61,8 @@ import 'html5parser';
|
|
|
96
61
|
}
|
|
97
62
|
parentPort.postMessage({ type: "result", id, result });
|
|
98
63
|
} catch (e) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const error = { message: message2, stack };
|
|
102
|
-
process.stderr.write(`${red("[vite-ssg-worker]")} ${message2} ${stack}
|
|
103
|
-
`);
|
|
104
|
-
parentPort.postMessage({ type: "error", id, error });
|
|
64
|
+
process.stdout.write(JSON.stringify(e));
|
|
65
|
+
parentPort.postMessage({ type: "error", id, error: e.toString() });
|
|
105
66
|
}
|
|
106
67
|
}
|
|
107
68
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InlineConfig } from 'vite';
|
|
2
|
-
import { b as ViteSSGOptions } from './vite-ssg-optimized.
|
|
2
|
+
import { b as ViteSSGOptions } from './vite-ssg-optimized.cf5cb4ee.cjs';
|
|
3
3
|
|
|
4
4
|
type Manifest = Record<string, string[]>;
|
|
5
5
|
declare function build(ssgOptions?: Partial<ViteSSGOptions & {
|
|
@@ -1059,8 +1059,9 @@ class BuildWorkerProxy {
|
|
|
1059
1059
|
if (type !== "log")
|
|
1060
1060
|
return;
|
|
1061
1061
|
const fn = console[level]?.bind(console);
|
|
1062
|
-
|
|
1063
|
-
|
|
1062
|
+
let msg = args.map((arg) => typeof arg === "object" && !!arg ? "[object]" : arg).join(" ");
|
|
1063
|
+
process.stdout.write(msg);
|
|
1064
|
+
fn?.(msg);
|
|
1064
1065
|
});
|
|
1065
1066
|
this.worker.on("message", (message) => {
|
|
1066
1067
|
const { id, type, result = void 0, error = void 0 } = message;
|
|
@@ -1159,13 +1160,12 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1159
1160
|
ssgOut: _ssgOutDir = node_path.join(root, ".vite-ssg-temp", Math.random().toString(36).substring(2, 12)),
|
|
1160
1161
|
formatting = "none",
|
|
1161
1162
|
minifyOptions = {},
|
|
1162
|
-
|
|
1163
|
+
crittersOptions = {},
|
|
1163
1164
|
beastiesOptions = {},
|
|
1164
1165
|
includedRoutes: configIncludedRoutes = DefaultIncludedRoutes,
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
numberOfWorkers: _numberOfWorkers = 5,
|
|
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.31f4c9de.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);
|
|
@@ -1219,11 +1219,9 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1219
1219
|
indexHTML = await formatHtml(indexHTML, IS_PROD ? "minify" : formatting, minifyOptions);
|
|
1220
1220
|
const queue = new PQueue({ concurrency });
|
|
1221
1221
|
const workerExt = format === "esm" ? ".mjs" : ".cjs";
|
|
1222
|
-
const createProxy = (
|
|
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.
|
|
1224
|
-
env: process__default.env,
|
|
1222
|
+
const createProxy = () => {
|
|
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.31f4c9de.cjs', document.baseURI).href))), {
|
|
1225
1224
|
workerData: {
|
|
1226
|
-
workerId: index,
|
|
1227
1225
|
serverEntry,
|
|
1228
1226
|
ssrManifest,
|
|
1229
1227
|
format,
|
|
@@ -1235,59 +1233,28 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1235
1233
|
formatting,
|
|
1236
1234
|
minifyOptions,
|
|
1237
1235
|
viteConfig: {
|
|
1238
|
-
configFile: config.configFile
|
|
1236
|
+
configFile: config.configFile || "vite.config.ts"
|
|
1239
1237
|
}
|
|
1240
1238
|
}
|
|
1241
1239
|
});
|
|
1242
1240
|
return workerProxy;
|
|
1243
1241
|
};
|
|
1244
|
-
const numberOfWorkers =
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
const terminateWorkers = () => {
|
|
1248
|
-
workers.splice(0, workers.length).forEach((worker) => worker.terminate());
|
|
1249
|
-
};
|
|
1250
|
-
process__default.on("SIGINT", terminateWorkers);
|
|
1251
|
-
process__default.on("SIGTERM", terminateWorkers);
|
|
1252
|
-
process__default.on("SIGBREAK", terminateWorkers);
|
|
1253
|
-
process__default.on("beforeExit", terminateWorkers);
|
|
1254
|
-
process__default.on("exit", terminateWorkers);
|
|
1255
|
-
const maxTasksPerWorker = Math.ceil(concurrency / numberOfWorkers);
|
|
1256
|
-
const workersInUse = /* @__PURE__ */ new Map();
|
|
1257
|
-
const selectWorker = async () => {
|
|
1258
|
-
const workerTasksRunning = (w) => workersInUse.get(w)?.length || 0;
|
|
1259
|
-
const worker = workers.filter((w) => workerTasksRunning(w) < maxTasksPerWorker).sort((a, b) => workerTasksRunning(a) - workerTasksRunning(b))[0];
|
|
1260
|
-
if (!worker) {
|
|
1261
|
-
await Promise.race(Array.from(workersInUse.values()).flat());
|
|
1262
|
-
return selectWorker();
|
|
1263
|
-
}
|
|
1264
|
-
const workerPromises = workersInUse.get(worker) || [];
|
|
1265
|
-
const delayPromise = new Promise((resolve) => setImmediate(resolve));
|
|
1266
|
-
workersInUse.set(worker, [...workerPromises, delayPromise]);
|
|
1267
|
-
delayPromise.finally(() => {
|
|
1268
|
-
workerPromises.splice(workerPromises.indexOf(delayPromise), 1);
|
|
1269
|
-
workersInUse.set(worker, workerPromises);
|
|
1270
|
-
});
|
|
1271
|
-
return worker;
|
|
1272
|
-
};
|
|
1242
|
+
const numberOfWorkers = 5;
|
|
1243
|
+
const workers = Array.from({ length: numberOfWorkers }, createProxy);
|
|
1244
|
+
let workerIndex = 0;
|
|
1273
1245
|
for (const route of routesPaths) {
|
|
1274
|
-
await queue.onSizeLessThan(concurrency);
|
|
1246
|
+
await queue.onSizeLessThan(concurrency + 5);
|
|
1247
|
+
const workerProxy = workers[workerIndex];
|
|
1248
|
+
workerIndex = (workerIndex + 1) % numberOfWorkers;
|
|
1275
1249
|
queue.add(async () => {
|
|
1276
|
-
const workerProxy = await selectWorker();
|
|
1277
1250
|
const taskPromise = executeTaskInWorker(workerProxy, {
|
|
1278
1251
|
route
|
|
1279
1252
|
});
|
|
1280
|
-
const workerPromises = workersInUse.get(workerProxy) || [];
|
|
1281
|
-
workersInUse.set(workerProxy, workerPromises);
|
|
1282
|
-
taskPromise.finally(() => {
|
|
1283
|
-
workerPromises.splice(workerPromises.indexOf(taskPromise), 1);
|
|
1284
|
-
workersInUse.set(workerProxy, workerPromises);
|
|
1285
|
-
});
|
|
1286
1253
|
return taskPromise;
|
|
1287
1254
|
});
|
|
1288
1255
|
}
|
|
1289
1256
|
await queue.start().onIdle();
|
|
1290
|
-
|
|
1257
|
+
workers.forEach((worker) => worker.terminate());
|
|
1291
1258
|
if (!ssgOptions["skip-build"]) {
|
|
1292
1259
|
await fs__default.remove(ssgOut);
|
|
1293
1260
|
}
|
|
@@ -1323,7 +1290,7 @@ async function executeTaskFn(opts) {
|
|
|
1323
1290
|
renderToString,
|
|
1324
1291
|
indexHTML,
|
|
1325
1292
|
onBeforePageRender,
|
|
1326
|
-
|
|
1293
|
+
onDonePageRender,
|
|
1327
1294
|
onPageRendered,
|
|
1328
1295
|
ssrManifest,
|
|
1329
1296
|
rootContainerId,
|
|
@@ -1379,10 +1346,10 @@ async function executeTaskFn(opts) {
|
|
|
1379
1346
|
const filename = dirStyle === "nested" ? node_path.join(route.replace(/^\//g, ""), "index.html") : relativeRouteFile;
|
|
1380
1347
|
await fs__default.ensureDir(node_path.join(out, node_path.dirname(filename)));
|
|
1381
1348
|
return fs__default.writeFile(node_path.join(out, filename), formatted, "utf-8").then(() => {
|
|
1382
|
-
const outDir = out.replace(process__default.cwd(), "").replace(/^\//, "");
|
|
1383
1349
|
config.logger.info(
|
|
1384
|
-
`${kolorist.dim(`${
|
|
1350
|
+
`${kolorist.dim(`${out}/`)}${kolorist.cyan(filename.padEnd(15, " "))} ${kolorist.dim(getSize(formatted))}`
|
|
1385
1351
|
);
|
|
1352
|
+
onDonePageRender?.(route, html, appCtx);
|
|
1386
1353
|
return { route, html };
|
|
1387
1354
|
});
|
|
1388
1355
|
} catch (err) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InlineConfig } from 'vite';
|
|
2
|
-
import { b as ViteSSGOptions } from './vite-ssg-optimized.
|
|
2
|
+
import { b as ViteSSGOptions } from './vite-ssg-optimized.cf5cb4ee.mjs';
|
|
3
3
|
|
|
4
4
|
type Manifest = Record<string, string[]>;
|
|
5
5
|
declare function build(ssgOptions?: Partial<ViteSSGOptions & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InlineConfig } from 'vite';
|
|
2
|
-
import { b as ViteSSGOptions } from './vite-ssg-optimized.
|
|
2
|
+
import { b as ViteSSGOptions } from './vite-ssg-optimized.cf5cb4ee.js';
|
|
3
3
|
|
|
4
4
|
type Manifest = Record<string, string[]>;
|
|
5
5
|
declare function build(ssgOptions?: Partial<ViteSSGOptions & {
|
|
@@ -113,13 +113,8 @@ interface ViteSSGOptions {
|
|
|
113
113
|
* It's useful to debug memory leaks
|
|
114
114
|
*
|
|
115
115
|
*/
|
|
116
|
+
onDonePageRender?: (route: string, renderedHTML: string, appCtx: ViteSSGContext<true>) => Promise<void> | void;
|
|
116
117
|
onFinished?: () => Promise<void> | void;
|
|
117
|
-
/**
|
|
118
|
-
* The number of workers to use.
|
|
119
|
-
*
|
|
120
|
-
* @default 5
|
|
121
|
-
*/
|
|
122
|
-
numberOfWorkers?: number;
|
|
123
118
|
/**
|
|
124
119
|
* The application's root container `id`.
|
|
125
120
|
*
|
|
@@ -113,13 +113,8 @@ interface ViteSSGOptions {
|
|
|
113
113
|
* It's useful to debug memory leaks
|
|
114
114
|
*
|
|
115
115
|
*/
|
|
116
|
+
onDonePageRender?: (route: string, renderedHTML: string, appCtx: ViteSSGContext<true>) => Promise<void> | void;
|
|
116
117
|
onFinished?: () => Promise<void> | void;
|
|
117
|
-
/**
|
|
118
|
-
* The number of workers to use.
|
|
119
|
-
*
|
|
120
|
-
* @default 5
|
|
121
|
-
*/
|
|
122
|
-
numberOfWorkers?: number;
|
|
123
118
|
/**
|
|
124
119
|
* The application's root container `id`.
|
|
125
120
|
*
|
|
@@ -113,13 +113,8 @@ interface ViteSSGOptions {
|
|
|
113
113
|
* It's useful to debug memory leaks
|
|
114
114
|
*
|
|
115
115
|
*/
|
|
116
|
+
onDonePageRender?: (route: string, renderedHTML: string, appCtx: ViteSSGContext<true>) => Promise<void> | void;
|
|
116
117
|
onFinished?: () => Promise<void> | void;
|
|
117
|
-
/**
|
|
118
|
-
* The number of workers to use.
|
|
119
|
-
*
|
|
120
|
-
* @default 5
|
|
121
|
-
*/
|
|
122
|
-
numberOfWorkers?: number;
|
|
123
118
|
/**
|
|
124
119
|
* The application's root container `id`.
|
|
125
120
|
*
|
|
@@ -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,
|
|
6
|
+
import { gray, yellow, blue, green, dim, cyan, 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';
|
|
@@ -1050,8 +1050,9 @@ class BuildWorkerProxy {
|
|
|
1050
1050
|
if (type !== "log")
|
|
1051
1051
|
return;
|
|
1052
1052
|
const fn = console[level]?.bind(console);
|
|
1053
|
-
|
|
1054
|
-
|
|
1053
|
+
let msg = args.map((arg) => typeof arg === "object" && !!arg ? "[object]" : arg).join(" ");
|
|
1054
|
+
process.stdout.write(msg);
|
|
1055
|
+
fn?.(msg);
|
|
1055
1056
|
});
|
|
1056
1057
|
this.worker.on("message", (message) => {
|
|
1057
1058
|
const { id, type, result = void 0, error = void 0 } = message;
|
|
@@ -1150,13 +1151,12 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1150
1151
|
ssgOut: _ssgOutDir = join(root, ".vite-ssg-temp", Math.random().toString(36).substring(2, 12)),
|
|
1151
1152
|
formatting = "none",
|
|
1152
1153
|
minifyOptions = {},
|
|
1153
|
-
|
|
1154
|
+
crittersOptions = {},
|
|
1154
1155
|
beastiesOptions = {},
|
|
1155
1156
|
includedRoutes: configIncludedRoutes = DefaultIncludedRoutes,
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
numberOfWorkers: _numberOfWorkers = 5,
|
|
1157
|
+
onBeforePageRender,
|
|
1158
|
+
onPageRendered,
|
|
1159
|
+
onDonePageRender,
|
|
1160
1160
|
onFinished,
|
|
1161
1161
|
dirStyle = "flat",
|
|
1162
1162
|
includeAllRoutes = false,
|
|
@@ -1210,11 +1210,9 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1210
1210
|
indexHTML = await formatHtml(indexHTML, IS_PROD ? "minify" : formatting, minifyOptions);
|
|
1211
1211
|
const queue = new PQueue({ concurrency });
|
|
1212
1212
|
const workerExt = format === "esm" ? ".mjs" : ".cjs";
|
|
1213
|
-
const createProxy = (
|
|
1213
|
+
const createProxy = () => {
|
|
1214
1214
|
const workerProxy = new BuildWorkerProxy(new URL(`./build.worker${workerExt}`, import.meta.url), {
|
|
1215
|
-
env: process$1.env,
|
|
1216
1215
|
workerData: {
|
|
1217
|
-
workerId: index,
|
|
1218
1216
|
serverEntry,
|
|
1219
1217
|
ssrManifest,
|
|
1220
1218
|
format,
|
|
@@ -1226,59 +1224,28 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1226
1224
|
formatting,
|
|
1227
1225
|
minifyOptions,
|
|
1228
1226
|
viteConfig: {
|
|
1229
|
-
configFile: config.configFile
|
|
1227
|
+
configFile: config.configFile || "vite.config.ts"
|
|
1230
1228
|
}
|
|
1231
1229
|
}
|
|
1232
1230
|
});
|
|
1233
1231
|
return workerProxy;
|
|
1234
1232
|
};
|
|
1235
|
-
const numberOfWorkers =
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
const terminateWorkers = () => {
|
|
1239
|
-
workers.splice(0, workers.length).forEach((worker) => worker.terminate());
|
|
1240
|
-
};
|
|
1241
|
-
process$1.on("SIGINT", terminateWorkers);
|
|
1242
|
-
process$1.on("SIGTERM", terminateWorkers);
|
|
1243
|
-
process$1.on("SIGBREAK", terminateWorkers);
|
|
1244
|
-
process$1.on("beforeExit", terminateWorkers);
|
|
1245
|
-
process$1.on("exit", terminateWorkers);
|
|
1246
|
-
const maxTasksPerWorker = Math.ceil(concurrency / numberOfWorkers);
|
|
1247
|
-
const workersInUse = /* @__PURE__ */ new Map();
|
|
1248
|
-
const selectWorker = async () => {
|
|
1249
|
-
const workerTasksRunning = (w) => workersInUse.get(w)?.length || 0;
|
|
1250
|
-
const worker = workers.filter((w) => workerTasksRunning(w) < maxTasksPerWorker).sort((a, b) => workerTasksRunning(a) - workerTasksRunning(b))[0];
|
|
1251
|
-
if (!worker) {
|
|
1252
|
-
await Promise.race(Array.from(workersInUse.values()).flat());
|
|
1253
|
-
return selectWorker();
|
|
1254
|
-
}
|
|
1255
|
-
const workerPromises = workersInUse.get(worker) || [];
|
|
1256
|
-
const delayPromise = new Promise((resolve) => setImmediate(resolve));
|
|
1257
|
-
workersInUse.set(worker, [...workerPromises, delayPromise]);
|
|
1258
|
-
delayPromise.finally(() => {
|
|
1259
|
-
workerPromises.splice(workerPromises.indexOf(delayPromise), 1);
|
|
1260
|
-
workersInUse.set(worker, workerPromises);
|
|
1261
|
-
});
|
|
1262
|
-
return worker;
|
|
1263
|
-
};
|
|
1233
|
+
const numberOfWorkers = 5;
|
|
1234
|
+
const workers = Array.from({ length: numberOfWorkers }, createProxy);
|
|
1235
|
+
let workerIndex = 0;
|
|
1264
1236
|
for (const route of routesPaths) {
|
|
1265
|
-
await queue.onSizeLessThan(concurrency);
|
|
1237
|
+
await queue.onSizeLessThan(concurrency + 5);
|
|
1238
|
+
const workerProxy = workers[workerIndex];
|
|
1239
|
+
workerIndex = (workerIndex + 1) % numberOfWorkers;
|
|
1266
1240
|
queue.add(async () => {
|
|
1267
|
-
const workerProxy = await selectWorker();
|
|
1268
1241
|
const taskPromise = executeTaskInWorker(workerProxy, {
|
|
1269
1242
|
route
|
|
1270
1243
|
});
|
|
1271
|
-
const workerPromises = workersInUse.get(workerProxy) || [];
|
|
1272
|
-
workersInUse.set(workerProxy, workerPromises);
|
|
1273
|
-
taskPromise.finally(() => {
|
|
1274
|
-
workerPromises.splice(workerPromises.indexOf(taskPromise), 1);
|
|
1275
|
-
workersInUse.set(workerProxy, workerPromises);
|
|
1276
|
-
});
|
|
1277
1244
|
return taskPromise;
|
|
1278
1245
|
});
|
|
1279
1246
|
}
|
|
1280
1247
|
await queue.start().onIdle();
|
|
1281
|
-
|
|
1248
|
+
workers.forEach((worker) => worker.terminate());
|
|
1282
1249
|
if (!ssgOptions["skip-build"]) {
|
|
1283
1250
|
await fs.remove(ssgOut);
|
|
1284
1251
|
}
|
|
@@ -1314,7 +1281,7 @@ async function executeTaskFn(opts) {
|
|
|
1314
1281
|
renderToString,
|
|
1315
1282
|
indexHTML,
|
|
1316
1283
|
onBeforePageRender,
|
|
1317
|
-
|
|
1284
|
+
onDonePageRender,
|
|
1318
1285
|
onPageRendered,
|
|
1319
1286
|
ssrManifest,
|
|
1320
1287
|
rootContainerId,
|
|
@@ -1370,10 +1337,10 @@ async function executeTaskFn(opts) {
|
|
|
1370
1337
|
const filename = dirStyle === "nested" ? join(route.replace(/^\//g, ""), "index.html") : relativeRouteFile;
|
|
1371
1338
|
await fs.ensureDir(join(out, dirname(filename)));
|
|
1372
1339
|
return fs.writeFile(join(out, filename), formatted, "utf-8").then(() => {
|
|
1373
|
-
const outDir = out.replace(process$1.cwd(), "").replace(/^\//, "");
|
|
1374
1340
|
config.logger.info(
|
|
1375
|
-
`${dim(`${
|
|
1341
|
+
`${dim(`${out}/`)}${cyan(filename.padEnd(15, " "))} ${dim(getSize(formatted))}`
|
|
1376
1342
|
);
|
|
1343
|
+
onDonePageRender?.(route, html, appCtx);
|
|
1377
1344
|
return { route, html };
|
|
1378
1345
|
});
|
|
1379
1346
|
} catch (err) {
|