Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"docusaurus": "docusaurus",
"start": "npm run generate-icon-types && docusaurus start --no-minify",
"start:current": "npm run generate-icon-types && cross-env DOCUSAURUS_VERSIONS='current' docusaurus start --no-minify",
"build": "npm run generate-icon-types && docusaurus build && tsx scripts/split-sitemap.ts && node scripts/generate-robots.js",
"build:current": "npm run generate-icon-types && cross-env DOCUSAURUS_VERSIONS='current' docusaurus build && tsx scripts/split-sitemap.ts && node scripts/generate-robots.js",
"build": "npm run generate-icon-types && node --max-old-space-size=8192 --require ./scripts/patch-fs.cjs ./node_modules/@docusaurus/core/bin/docusaurus.mjs build && tsx scripts/split-sitemap.ts && node scripts/generate-robots.js",
"build:current": "npm run generate-icon-types && cross-env DOCUSAURUS_VERSIONS='current' node --max-old-space-size=8192 --require ./scripts/patch-fs.cjs ./node_modules/@docusaurus/core/bin/docusaurus.mjs build && tsx scripts/split-sitemap.ts && node scripts/generate-robots.js",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand Down
8 changes: 4 additions & 4 deletions scripts/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ if ($LASTEXITCODE) { throw 'Docusaurus build failed' }
$BuildDir = [IO.Path]::Combine($PSScriptRoot, '..', 'build')
if (-not (Test-Path $BuildDir)) { throw "Build folder not produced ($BuildDir)" }

# Warn (don't block) if the build emitted any empty (0-byte) asset.
$empty = Get-ChildItem $BuildDir -Recurse -File | Where-Object { $_.Length -eq 0 -and $_.Name -ne '.nojekyll' }
# Warn on empty (0-byte) assets under build/assets/ (static/ files may be 0 bytes on purpose).
$empty = Get-ChildItem (Join-Path $BuildDir 'assets') -Recurse -File -ErrorAction SilentlyContinue | Where-Object { $_.Length -eq 0 }
if ($empty) {
Write-Warning "Build produced $($empty.Count) empty file(s): $(($empty | Select-Object -First 20 -ExpandProperty Name) -join ', ')"
Write-Warning "Build produced $($empty.Count) empty (0-byte) asset(s) under assets/, e.g.: $(($empty | Select-Object -First 10 -ExpandProperty Name) -join ', ')"
}

if ($DryRun) {
Expand All @@ -199,7 +199,7 @@ if ($DryRun) {

# Phase 1 — upload new hashed assets without --delete so old bundles remain
# on S3 while CloudFront still serves the old index.html from edge cache
# cached aggresively
# cached aggresively
Write-Host " [1/4] Upload: hashed assets (assets/*)" -ForegroundColor Gray
aws s3 sync $BuildDir "s3://$S3BucketName/" --only-show-errors `
--exclude "*" `
Expand Down
5 changes: 5 additions & 0 deletions scripts/patch-fs.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
try {
require("graceful-fs").gracefulify(require("fs"));
} catch (err) {
console.warn(`[patch-fs] graceful-fs unavailable; EMFILE mitigation skipped: ${err.message}`);
}
Loading