Check build.outDir in vite.config (should be dist)
Build crashes on type errors
Run pages-prepare-vite to ensure TypeScript is configured
Assets 404 on deployed site
Verify base matches the repo name exactly
Guidelines
Run from the project root
Does not commit or push anything
Safe to run repeatedly — cleans and rebuilds dist/ each time
Fix any build errors before proceeding to pages-commit-vite
1---2name: pages-build-vite3description: pages-build-vite4---56# pages-build-vite78Locally build the Vite project and verify the `dist/` output is ready for Pages deployment.910## When to Use1112- After `pages-prepare-vite` has patched `vite.config.ts` and written the workflow13- Before committing — to confirm the build succeeds locally14- When troubleshooting Pages deployment failures (reproduce the CI build locally)1516## Pipeline Position1718```text19pages-prepare-vite → [pages-build-vite] → pages-commit-vite → pages-push-vite → pages-publish-vite20```2122## What This Skill Does23241. Detects package manager from lockfile (`pnpm-lock.yaml` → pnpm, `yarn.lock` → yarn, else npm)252. Checks that `vite.config.ts` has a `base` property set263. Runs `npm run build` / `pnpm run build` / `yarn build`274. Verifies `dist/` exists and contains `dist/index.html`2829> `dist/` is gitignored — the workflow builds it fresh in CI. This step is local verification only.3031## How to Use3233```bash34bash skills/pages-build-vite/scripts/build_pages.sh35```3637## Expected Output3839```text40=== pages-build-vite ===41 Package manager: npm42 base: '/my-app/'4344── Running build45... vite build output ...4647── Verifying dist/48 ✓ dist/ exists49 ✓ 42 files50 ✓ dist/index.html present: yes5152=== Build verified — ready for pages-commit-vite ===53```5455## Common Issues5657| Symptom | Fix |58| --------- | ----- |59| `No 'base' property found` | Run `pages-prepare-vite` first |60| `dist/index.html` missing | Check `build.outDir` in vite.config (should be `dist`) |61| Build crashes on type errors | Run `pages-prepare-vite` to ensure TypeScript is configured |62| Assets 404 on deployed site | Verify `base` matches the repo name exactly |6364## Guidelines6566- Run from the project root67- Does not commit or push anything68- Safe to run repeatedly — cleans and rebuilds `dist/` each time69- Fix any build errors before proceeding to `pages-commit-vite`
Run npx skillmds@latest add stuffbucket/pages-build-vite in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
pages-build-vite It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
stuffbucket (@stuffbucket) published this skill. Their other Agent Skills are listed on their SkillMD profile.