Deploy to Netlify
About 526 wordsAbout 2 min
2026-08-31
This guide covers Netlify platform configuration. For decisions on build locations and managing platform build commands, see Deployment Overview.
Requirements
- Source code is pushed to GitHub, GitLab, Bitbucket, or Azure DevOps;
siteis set to your production domain (editsrc/config/siteConfig.tsin single-repo mode, orconfig/site.yamlin the content repo).
For dual-repo setups, configure CONTENT_REPO_URL (with an access token for private repos), optionally CONTENT_REPO_REF, and GIT_TERMINAL_PROMPT=0 as platform environment variables. See Content Sources.
Option 1: import from the dashboard
Import project
Log into the Netlify dashboard and click Add a new site -> Import an existing project.
Select repository
Choose your Git provider, grant permissions, and select the Shirone repository.
Confirm build settings
Verify the following parameters:
Setting Value Build command pnpm buildPublish directory distAdd environment variables
Add
NODE_VERSION = 26. For dual-repo mode, configure the three content source variables as well.Deploy
Click Deploy to initiate the build.
Option 2: netlify.toml
Commit build settings to the repository root to avoid relying on manual dashboard setup:
[build]
command = "pnpm build"
publish = "dist"
[build.environment]
NODE_VERSION = "26"Push this file to your repository; Netlify reads and applies these settings on the next build.
Option 3: CLI
pnpm add -g netlify-cli
netlify login
netlify init
netlify deploy --build --prodnetlify init links the repository and installs a deploy key so subsequent git push commands trigger automatic builds.
Already built locally?
--build causes the Netlify CLI to re-run the entire build locally. If you already ran pnpm build, upload existing artifacts directly:
netlify deploy --prod --dir=distThe uploaded directory must include the complete dist/pagefind/ folder.
Preview deployments
After importing, pushes to non-production branches and Pull Requests automatically generate isolated preview sites. Push drafts to a branch, inspect layouts on the preview URL, and merge into main when verified.
Custom domain
- Go to Site settings -> Domain management -> Add a domain, and enter your domain;
- Configure DNS records according to the Netlify console instructions;
- Let's Encrypt provisions and renews SSL certificates automatically.
Troubleshooting
Build fails with a pnpm version mismatch
NODE_VERSION specifies only the Node.js runtime. Netlify prefers reading packageManager in package.json (this repository locks to pnpm@11.28.2). If versions still mismatch, adjust the build command in netlify.toml:
[build]
command = "npm i -g pnpm@11.28.2 && pnpm build"
publish = "dist"Build fails becausecorepack is missing
Node.js 26 no longer bundles corepack. Run npm i -g corepack && corepack enable prior to invocation, or install pnpm globally with npm directly.
Too many files in a single deployment
Netlify enforces limits on file counts and site size per deployment. Check public/ to ensure uncompressed high-resolution images are not included inadvertently.
High latency from mainland China
Netlify CDN edge routing from mainland China can fluctuate. If most of your readership is in China, consider EdgeOne Pages.
Next steps
- Deployment Overview: compare other hosting providers
- Cross-Repo CI: build using GitHub Actions and deliver
Copyright
Copyright Ownership:Dawn6666666
License under:Attribution 4.0 International (CC-BY-4.0)