Existing Sage Projects

The majority of the Sage documentation focuses on setting up new themes. Use this document If you are collaborating on, or taking over an existing theme.

Getting started

If you've never worked on a Sage project before, make sure your local development environment is configured by following the Getting Started guide(s).

Gathering information

To work on an existing Sage project you need to know what version of Sage you're working with. You can usually find this by checking the package.json file:

  "name": "sage",
  "version": "9.0.5",

If your package.json file doesn't contain the Sage version number, look for a bower.json file. If this file exists, it's safe to assume you're working with Sage 8. Otherwise assume you're working with Sage 9.

Set up your development environment

Prepare your development environment based on what version of Sage you're working with.

Sage 9

Set Node.js version with nvm:

$ nvm install --lts

Install Composer dependencies:

$ composer install

Install Node dependencies:

$ yarn

Build your project:

yarn build

For complete details on working with Sage 9, see the Sage 9 documentation or consider purchasing the book!

Sage 8

Set Node.js version 4.5 with nvm:

$ nvm use 4.5

Install Node dependencies:

$ npm install

Install Bower dependencies:

$ bower install

Build your project with:

$ gulp

For complete details on working with Sage 8, see the archived Sage 8 documentation.

Join over 6,000 subscribers on our newsletter to get the latest Roots updates, along with occasional tips on building better WordPress sites.

Looking for WordPress plugin recommendations, the newest modern WordPress projects, and general web development tips and articles?

“Easily the best WordPress email I get.” Colin OBrien

Follow us on Twitter @rootswp

Ready to checkout?