mnfst-render 0.5.47 → 0.5.48
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 +16 -0
- package/package.json +1 -1
package/manifest.render.mjs
CHANGED
|
@@ -3523,13 +3523,20 @@ const COPY_EXCLUDE = new Set([
|
|
|
3523
3523
|
'CLAUDE.md', 'AGENTS.md', 'manifest.schema.json',
|
|
3524
3524
|
]);
|
|
3525
3525
|
|
|
3526
|
+
// Capacitor-wrapped projects: native projects and config stay out of the web
|
|
3527
|
+
// output, else each `cap sync` nests ios/App/App/public/ios/… deeper.
|
|
3528
|
+
const CAPACITOR_CONFIGS = ['capacitor.config.json', 'capacitor.config.ts', 'capacitor.config.js'];
|
|
3529
|
+
const CAPACITOR_EXCLUDE = new Set(['ios', 'android', ...CAPACITOR_CONFIGS]);
|
|
3530
|
+
|
|
3526
3531
|
function copyProjectIntoDist(rootResolved, outputResolved) {
|
|
3527
3532
|
const outputDirName = basename(outputResolved);
|
|
3528
3533
|
COPY_EXCLUDE.add(outputDirName);
|
|
3534
|
+
const wrapped = CAPACITOR_CONFIGS.some((f) => existsSync(join(rootResolved, f)));
|
|
3529
3535
|
const entries = readdirSync(rootResolved, { withFileTypes: true });
|
|
3530
3536
|
for (const ent of entries) {
|
|
3531
3537
|
const name = ent.name;
|
|
3532
3538
|
if (COPY_EXCLUDE.has(name) || name.startsWith('.')) continue;
|
|
3539
|
+
if (wrapped && CAPACITOR_EXCLUDE.has(name)) continue;
|
|
3533
3540
|
const src = join(rootResolved, name);
|
|
3534
3541
|
const dest = join(outputResolved, name);
|
|
3535
3542
|
cpSync(src, dest, {
|
|
@@ -3727,11 +3734,19 @@ async function runPrerender(config) {
|
|
|
3727
3734
|
const lockBasename = basename(outputLockPath(finalOutput));
|
|
3728
3735
|
COPY_EXCLUDE.add(finalBasename);
|
|
3729
3736
|
COPY_EXCLUDE.add(lockBasename);
|
|
3737
|
+
// An --out render (e.g. a Capacitor webDir) also skips the configured web output.
|
|
3738
|
+
const renderBlock = config.manifest?.render ?? config.manifest?.prerender ?? {};
|
|
3739
|
+
const configuredOutput = resolve(rootResolved, renderBlock.output ?? 'website');
|
|
3740
|
+
const configuredBasename = dirname(configuredOutput) === rootResolved && !COPY_EXCLUDE.has(basename(configuredOutput))
|
|
3741
|
+
? basename(configuredOutput)
|
|
3742
|
+
: null;
|
|
3743
|
+
if (configuredBasename) COPY_EXCLUDE.add(configuredBasename);
|
|
3730
3744
|
try {
|
|
3731
3745
|
copyProjectIntoDist(rootResolved, outputResolved);
|
|
3732
3746
|
} finally {
|
|
3733
3747
|
COPY_EXCLUDE.delete(finalBasename);
|
|
3734
3748
|
COPY_EXCLUDE.delete(lockBasename);
|
|
3749
|
+
if (configuredBasename) COPY_EXCLUDE.delete(configuredBasename);
|
|
3735
3750
|
}
|
|
3736
3751
|
// Env placeholders (${VAR}) only resolve at runtime via window.env (populated
|
|
3737
3752
|
// by the mnfst-run dev server from .env). A static prod build has no
|
|
@@ -5545,6 +5560,7 @@ export {
|
|
|
5545
5560
|
groupLlmsSections,
|
|
5546
5561
|
acquireOutputLock,
|
|
5547
5562
|
outputLockPath,
|
|
5563
|
+
copyProjectIntoDist,
|
|
5548
5564
|
markPrerenderedManifestComponents,
|
|
5549
5565
|
normalizeLocaleRouteExclude,
|
|
5550
5566
|
isLocaleRouteExcluded,
|