1.2 KiB
1.2 KiB
name, description, license, triggers
| name | description | license | triggers | |||
|---|---|---|---|---|---|---|
| build-run-script | Ensures `package.json` scripts for dev, build, preview, lint, test, and format are present and validates environment variable usage before running. | MIT |
|
Build & Run Script
When to use this skill
- Use when bootstrapping the project's
package.jsonscripts or when validating build-time env variables. - Triggered by requests to add/update
dev,build,preview, or helper scripts.
Instructions
- First Step: Ensure
package.jsoncontains scripts:
dev:vitebuild:vite buildpreview:vite preview --port 4173lint,test,formathelpers as needed.
-
Second Step: Add a script
start:ciif CI needs to build and run a static server (e.g.,serve -s dist). -
Third Step: Validate that required
VITE_variables are documented and, optionally, verified at runtime with a small pre-flight check.
Examples
npm run devto start local dev server;npm run build && npm run previewto test production output locally.
Notes
- Encourage
cross-envor platform-neutral approaches when setting env vars in scripts.