Skip to content

Commit 73dca98

Browse files
committed
fix: vite-plugin-static-copy patch and build configuration
- Extended vite-plugin-static-copy patch with two fixes: - Environment guard now defaults to 'client' when no environment option is passed - Corrected outDir resolution per environment (SSR vs client) - Re-applied astro.config.mjs maxParallelFileOps: 8 for stable builds - Reverted links validator condition to !process.env.NETLIFY for local validation - Updated pnpm-lock.yaml from patch changes - Added BUILD_AUDIT.md and BUILD_COMPARISON.md to .gitignore - Documented patch changes in project-docs/PATCHES.md
1 parent ba4000e commit 73dca98

6 files changed

Lines changed: 31 additions & 674 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ docs/superpowers/
5454
venv/
5555
.venv/
5656
examples/*
57+
project-docs/BUILD_AUDIT.md
58+
project-docs/BUILD_COMPARISON.md

astro.config.mjs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,9 @@ export default defineConfig({
105105
askAi: '8jKZkVuXS0hG',
106106
}),
107107
starlightVideos(),
108-
// Links validator: enabled locally and on deploy previews; skipped on production
109-
// Netlify builds to reduce peak memory usage.
110-
// CONTEXT is set by Netlify: 'production' | 'deploy-preview' | 'branch-deploy'
111-
...(!process.env.NETLIFY || process.env.CONTEXT !== 'production'
108+
// Links validator disabled in CI to reduce build memory usage.
109+
// Run locally with: pnpm astro build (without NETLIFY env var)
110+
...(!process.env.NETLIFY
112111
? [
113112
starlightLinksValidator({
114113
exclude: ['/apis/**'],
@@ -411,8 +410,6 @@ export default defineConfig({
411410
// Disable gzip size reporting to save memory on large builds
412411
reportCompressedSize: false,
413412
rollupOptions: {
414-
// Limit parallel file I/O to reduce memory spikes during bundling.
415-
// 8 caps concurrency well below unlimited while reducing serialization vs. the prior value of 2.
416413
maxParallelFileOps: 8,
417414
output: {
418415
manualChunks(id) {

patches/vite-plugin-static-copy@4.1.0.patch

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@ diff --git a/dist/index.js b/dist/index.js
22
index 8703f1bd5f6438c61a80b9fc842722820bd9a49f..835dfa2cf82fae6eee47fb478108055d858856a3 100644
33
--- a/dist/index.js
44
+++ b/dist/index.js
5-
@@ -1069,7 +1069,8 @@ const buildPlugin = ({ targets, silent, hook, environment }) => {
6-
if (this.environment && this.environment.name !== environment) return;
5+
@@ -1063,13 +1063,14 @@ const buildPlugin = ({ targets, silent, hook, environment }) => {
6+
},
7+
buildEnd() {
8+
- if (this.environment && this.environment.name !== environment) return;
9+
+ if (this.environment && this.environment.name !== (environment ?? 'client')) return;
10+
output = false;
11+
},
12+
async [hook]() {
13+
- if (this.environment && this.environment.name !== environment) return;
14+
+ if (this.environment && this.environment.name !== (environment ?? 'client')) return;
715
if (output) return;
816
output = true;
917
- const result = await copyAll(config.root, config.build.outDir, targets, silent);

pnpm-lock.yaml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)