This guide will walk you through the installation process and help you set up your first CampsiteJS static site. We’ll cover the prerequisites, installation steps, and how to create your first site.
Prerequisites
Before you begin, ensure you have the following installed on your machine:
- Node.js: CampsiteJS requires Node.js version 18 or higher. You can download it from nodejs.org.
- npm, pnpm, yarn or bun: npm comes bundled with Node.js; pnpm/yarn/bun are also supported (auto-detected in init).
- Git: While not strictly necessary, having Git installed is recommended for version control and managing your CampsiteJS projects. You can download it from git-scm.com.
Quick Start (Recommended)
The easiest way to create a new CampsiteJS project:
npm create campsitejs@latest my-site
cd my-site
npm install
camper dev
This uses create-campsitejs to scaffold a new project with campsite.config.js, folders, and starter files.
Alternative: Global CLI
For the camper command available everywhere:
npm install -g basecampjs
Then in any folder:
camper init
npm install
camper dev
After Scaffolding
Your project will have scripts in package.json:
{
"scripts": {
"dev": "camper dev",
"build": "camper build",
"serve": "camper serve",
"preview": "camper preview"
}
}
camper dev— start dev server (http://localhost:4173)camper build— production build topublic/(or youroutDir)camper preview— build + serve production version
Configuration: Edit campsite.config.js to set outDir, templateEngine, integrations, hooks, etc. See the Configuration Reference.
Manual Setup (Advanced)
If you prefer not to use the scaffolder, create the files manually:
npm init -y && npm install basecampjs- Create
campsite.config.jswithexport default { siteName: "My Site", ... } - Create
src/pages/index.md,src/layouts/base.njk,static/style.css - Add scripts and run
camper dev
Next Steps
- CLI Reference — All
campercommands - Configuration — Full options
- Deploying — Host your site