vite-ssg-optimized 0.24.2-optimized.30 → 0.24.2-optimized.31
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 +6 -6
- package/dist/shared/build.worker.mjs +6 -6
- package/dist/shared/{vite-ssg-optimized.3c973855.cjs → vite-ssg-optimized.1efabb47.cjs} +3 -7
- package/dist/shared/{vite-ssg-optimized.7b0cf7d1.mjs → vite-ssg-optimized.44cef1f4.mjs} +1 -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.1efabb47.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.44cef1f4.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.1efabb47.cjs');
|
|
6
6
|
const kolorist = require('kolorist');
|
|
7
7
|
const vite = require('vite');
|
|
8
8
|
require('node:path');
|
|
@@ -84,13 +84,13 @@ async function getBeastiesOrCritters(outDir, options = {}) {
|
|
|
84
84
|
createAppPromise ?? (createAppPromise = Promise.resolve(format === "esm" ? import(serverEntry) : _require(serverEntry)).then(({ createApp: createApp2 }) => createApp2));
|
|
85
85
|
const createApp = await createAppPromise;
|
|
86
86
|
const beastiesOptions = opts.beastiesOptions;
|
|
87
|
-
beastiesPromise ?? (beastiesPromise = Promise.resolve(beastiesOptions !== false ? getBeastiesOrCritters(outDir, beastiesOptions) : void 0).then((
|
|
88
|
-
if (!
|
|
87
|
+
beastiesPromise ?? (beastiesPromise = Promise.resolve(beastiesOptions !== false ? getBeastiesOrCritters(outDir, beastiesOptions) : void 0).then((beasties3) => {
|
|
88
|
+
if (!beasties3)
|
|
89
89
|
return;
|
|
90
90
|
console.log(`${kolorist.gray("[vite-ssg]")} ${kolorist.blue("Critical CSS generation enabled via `beasties`")}`);
|
|
91
|
-
return
|
|
91
|
+
return beasties3;
|
|
92
92
|
}));
|
|
93
|
-
const
|
|
93
|
+
const beasties2 = await beastiesPromise;
|
|
94
94
|
const newOpts = {
|
|
95
95
|
...extraOpts,
|
|
96
96
|
out,
|
|
@@ -100,7 +100,7 @@ async function getBeastiesOrCritters(outDir, options = {}) {
|
|
|
100
100
|
onPageRendered,
|
|
101
101
|
onBeforePageRender,
|
|
102
102
|
// onDonePageRender: onDonePageRender,
|
|
103
|
-
beasties,
|
|
103
|
+
beasties: beasties2,
|
|
104
104
|
config: { logger: { info: (msg) => {
|
|
105
105
|
node_worker_threads.parentPort.postMessage({ type: "log", args: [msg] });
|
|
106
106
|
} } },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { parentPort, workerData } from 'node:worker_threads';
|
|
3
|
-
import { p as plainify, e as executeTaskFn, a as buildClient, c as buildServer } from './vite-ssg-optimized.
|
|
3
|
+
import { p as plainify, e as executeTaskFn, a as buildClient, c as buildServer } from './vite-ssg-optimized.44cef1f4.mjs';
|
|
4
4
|
import { red, gray, blue } from 'kolorist';
|
|
5
5
|
import { resolveConfig } from 'vite';
|
|
6
6
|
import 'node:path';
|
|
@@ -81,13 +81,13 @@ async function getBeastiesOrCritters(outDir, options = {}) {
|
|
|
81
81
|
createAppPromise ?? (createAppPromise = Promise.resolve(format === "esm" ? import(serverEntry) : _require(serverEntry)).then(({ createApp: createApp2 }) => createApp2));
|
|
82
82
|
const createApp = await createAppPromise;
|
|
83
83
|
const beastiesOptions = opts.beastiesOptions;
|
|
84
|
-
beastiesPromise ?? (beastiesPromise = Promise.resolve(beastiesOptions !== false ? getBeastiesOrCritters(outDir, beastiesOptions) : void 0).then((
|
|
85
|
-
if (!
|
|
84
|
+
beastiesPromise ?? (beastiesPromise = Promise.resolve(beastiesOptions !== false ? getBeastiesOrCritters(outDir, beastiesOptions) : void 0).then((beasties3) => {
|
|
85
|
+
if (!beasties3)
|
|
86
86
|
return;
|
|
87
87
|
console.log(`${gray("[vite-ssg]")} ${blue("Critical CSS generation enabled via `beasties`")}`);
|
|
88
|
-
return
|
|
88
|
+
return beasties3;
|
|
89
89
|
}));
|
|
90
|
-
const
|
|
90
|
+
const beasties2 = await beastiesPromise;
|
|
91
91
|
const newOpts = {
|
|
92
92
|
...extraOpts,
|
|
93
93
|
out,
|
|
@@ -97,7 +97,7 @@ async function getBeastiesOrCritters(outDir, options = {}) {
|
|
|
97
97
|
onPageRendered,
|
|
98
98
|
onBeforePageRender,
|
|
99
99
|
// onDonePageRender: onDonePageRender,
|
|
100
|
-
beasties,
|
|
100
|
+
beasties: beasties2,
|
|
101
101
|
config: { logger: { info: (msg) => {
|
|
102
102
|
parentPort.postMessage({ type: "log", args: [msg] });
|
|
103
103
|
} } },
|
|
@@ -1031,11 +1031,7 @@ class BuildWorkerProxy {
|
|
|
1031
1031
|
return;
|
|
1032
1032
|
const fn = console[level]?.bind(console);
|
|
1033
1033
|
const workerId = options.workerData.workerId;
|
|
1034
|
-
|
|
1035
|
-
const msg = typeof first === "string" ? first.replace(/\n$/g, "") : void 0;
|
|
1036
|
-
const last = rest[rest.length - 1];
|
|
1037
|
-
const endMsg = last === void 0 ? kolorist.reset("") : "";
|
|
1038
|
-
fn?.(`[woker #${workerId}] ${msg}${endMsg}`, msg, ...rest.slice(0, -1));
|
|
1034
|
+
fn?.(`[woker #${workerId}] `, ...args, kolorist.reset(""));
|
|
1039
1035
|
});
|
|
1040
1036
|
this.worker.on("message", (message) => {
|
|
1041
1037
|
const { id, type, result = void 0, error = void 0 } = message;
|
|
@@ -1126,7 +1122,7 @@ async function buildServer(config, viteConfig, { ssrEntry, ssgOut, format, mock
|
|
|
1126
1122
|
}
|
|
1127
1123
|
function createProxy(options) {
|
|
1128
1124
|
const workerExt = options.format === "esm" ? ".mjs" : ".cjs";
|
|
1129
|
-
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.
|
|
1125
|
+
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.1efabb47.cjs', document.baseURI).href))), {
|
|
1130
1126
|
env: process__default.env,
|
|
1131
1127
|
workerData: options
|
|
1132
1128
|
});
|
|
@@ -1234,7 +1230,7 @@ async function build(ssgOptions = {}, viteConfig = {}) {
|
|
|
1234
1230
|
return worker;
|
|
1235
1231
|
};
|
|
1236
1232
|
const serverEntry = prefix + node_path.join(ssgOut, node_path.parse(ssrEntry).name + ext).replace(/\\/g, "/");
|
|
1237
|
-
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.
|
|
1233
|
+
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.1efabb47.cjs', document.baseURI).href)));
|
|
1238
1234
|
const { createApp, includedRoutes: serverEntryIncludedRoutes } = format === "esm" ? await import(serverEntry) : _require(serverEntry);
|
|
1239
1235
|
const includedRoutes = serverEntryIncludedRoutes || configIncludedRoutes;
|
|
1240
1236
|
const { routes } = await createApp(false);
|
|
@@ -1022,11 +1022,7 @@ class BuildWorkerProxy {
|
|
|
1022
1022
|
return;
|
|
1023
1023
|
const fn = console[level]?.bind(console);
|
|
1024
1024
|
const workerId = options.workerData.workerId;
|
|
1025
|
-
|
|
1026
|
-
const msg = typeof first === "string" ? first.replace(/\n$/g, "") : void 0;
|
|
1027
|
-
const last = rest[rest.length - 1];
|
|
1028
|
-
const endMsg = last === void 0 ? reset("") : "";
|
|
1029
|
-
fn?.(`[woker #${workerId}] ${msg}${endMsg}`, msg, ...rest.slice(0, -1));
|
|
1025
|
+
fn?.(`[woker #${workerId}] `, ...args, reset(""));
|
|
1030
1026
|
});
|
|
1031
1027
|
this.worker.on("message", (message) => {
|
|
1032
1028
|
const { id, type, result = void 0, error = void 0 } = message;
|