Prerequisites
Saber requires Node.js 8 or above.
When you have Node.js installed on your machine, the node and npm commands will be available in your terminal.
Run following command to check your Node.js version:
node -vCreating a New Project from Scratch
Creating a new directory my-site and populate a package.json:
mkdir my-site
cd my-site
npm init -yInstall Saber with npm:
npm install saberAlternatively, you can also install Saber with Yarn which is an alternative package manager developed by Facebook:
yarn add saberMake sure you have Yarn installed first.
Configure scripts in package.json:
{
"scripts": {
"dev": "saber",
"build": "saber build"
}
}Then you can run npm run dev to start the dev server, or run npm run build to create a production build of your app.
Using the Generator
You can also generate a new site with just a single command:
npm init site my-siteOr using Yarn:
yarn create site my-siteThen start the dev server:
cd my-site
npm install
npm run devFor more details, check out the README.md in my-site/.
CodeSandbox Example
The easiest way to try out Saber is to edit and preview the example project on CodeSandbox.