mnfst-render 0.4.8 → 0.4.9
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/manifest.render.mjs +11 -21
- package/package.json +1 -1
package/manifest.render.mjs
CHANGED
|
@@ -229,23 +229,18 @@ function resolveConfig() {
|
|
|
229
229
|
locales: pre.locales,
|
|
230
230
|
redirects: Array.isArray(pre.redirects) ? pre.redirects : [],
|
|
231
231
|
wait: cli.wait ?? pre.wait ?? null,
|
|
232
|
-
waitAfterIdle:
|
|
232
|
+
waitAfterIdle: 0,
|
|
233
233
|
concurrency: Math.max(1, cli.concurrency ?? pre.concurrency ?? Math.max(4, cpus().length - 1)),
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
localeSubstitution: pre.localeSubstitution !== false,
|
|
237
|
-
/** Locales to always render with Puppeteer even when localeSubstitution is enabled (e.g. RTL). */
|
|
238
|
-
localeSubstitutionExclude: Array.isArray(pre.localeSubstitutionExclude)
|
|
239
|
-
? pre.localeSubstitutionExclude.map(String)
|
|
240
|
-
: [],
|
|
234
|
+
localeSubstitution: true,
|
|
235
|
+
localeSubstitutionExclude: [],
|
|
241
236
|
/** Explicit locale-neutral paths to render in addition to those discovered automatically.
|
|
242
237
|
* Each entry is expanded to all locale variants (e.g. "legal/privacy" → "cs/legal/privacy", ...) */
|
|
243
238
|
paths: Array.isArray(pre.paths)
|
|
244
239
|
? pre.paths.map((p) => String(p).replace(/^\/+|\/+$/g, '')).filter(Boolean)
|
|
245
240
|
: [],
|
|
246
241
|
dryRun: !!cli.dryRun,
|
|
247
|
-
debugPrerender: !!
|
|
248
|
-
pipelineTimeout:
|
|
242
|
+
debugPrerender: !!cli.debugPrerender,
|
|
243
|
+
pipelineTimeout: 25000,
|
|
249
244
|
};
|
|
250
245
|
}
|
|
251
246
|
|
|
@@ -694,13 +689,11 @@ function promptContinueWithRuntimeTailwind(rootDir) {
|
|
|
694
689
|
|
|
695
690
|
/**
|
|
696
691
|
* Build a static Tailwind stylesheet via @tailwindcss/cli (v4+), scanning project sources.
|
|
697
|
-
* Only runs when the project
|
|
692
|
+
* Only runs when the project uses data-tailwind on the manifest script tag (auto-detected).
|
|
693
|
+
* Set manifest.prerender.tailwindInput to a custom CSS entry file if needed.
|
|
698
694
|
*/
|
|
699
695
|
function runTailwindCliForPrerender(rootDir, outputDir, pre) {
|
|
700
|
-
|
|
701
|
-
if (explicit === false) return false;
|
|
702
|
-
const usesTailwind = explicit === true || indexHtmlUsesTailwind(rootDir);
|
|
703
|
-
if (!usesTailwind) return false;
|
|
696
|
+
if (!indexHtmlUsesTailwind(rootDir)) return false;
|
|
704
697
|
|
|
705
698
|
const outCss = join(outputDir, 'prerender.tailwind.css');
|
|
706
699
|
try {
|
|
@@ -708,7 +701,7 @@ function runTailwindCliForPrerender(rootDir, outputDir, pre) {
|
|
|
708
701
|
} catch {
|
|
709
702
|
const proceed = promptContinueWithRuntimeTailwind(rootDir);
|
|
710
703
|
if (!proceed) {
|
|
711
|
-
throw new Error('prerender aborted: install tailwindcss/@tailwindcss/cli or
|
|
704
|
+
throw new Error('prerender aborted: install tailwindcss/@tailwindcss/cli or remove data-tailwind from your manifest script tag.');
|
|
712
705
|
}
|
|
713
706
|
process.stdout.write('prerender: continuing with runtime data-tailwind behavior.\n');
|
|
714
707
|
return false;
|
|
@@ -726,15 +719,12 @@ function runTailwindCliForPrerender(rootDir, outputDir, pre) {
|
|
|
726
719
|
}
|
|
727
720
|
|
|
728
721
|
const outputBasename = basename(outputDir);
|
|
729
|
-
const
|
|
722
|
+
const contentGlobs = [
|
|
730
723
|
'**/*.html',
|
|
731
724
|
'!**/node_modules/**',
|
|
732
725
|
'!**/dist/**',
|
|
733
726
|
`!**/${outputBasename}/**`,
|
|
734
727
|
];
|
|
735
|
-
const contentGlobs = Array.isArray(pre?.tailwindContent) && pre.tailwindContent.length > 0
|
|
736
|
-
? pre.tailwindContent
|
|
737
|
-
: defaultContent;
|
|
738
728
|
|
|
739
729
|
const args = [
|
|
740
730
|
'--yes',
|
|
@@ -762,7 +752,7 @@ function runTailwindCliForPrerender(rootDir, outputDir, pre) {
|
|
|
762
752
|
}
|
|
763
753
|
}
|
|
764
754
|
if (r.status !== 0) {
|
|
765
|
-
console.error('prerender: Tailwind CLI failed; install with `npm i -D tailwindcss @tailwindcss/cli` or
|
|
755
|
+
console.error('prerender: Tailwind CLI failed; install with `npm i -D tailwindcss @tailwindcss/cli` or check tailwindInput in manifest.prerender.');
|
|
766
756
|
if (r.stderr) console.error(r.stderr);
|
|
767
757
|
if (r.stdout) console.error(r.stdout);
|
|
768
758
|
return false;
|