Working on an Existing Sage Project

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 < 10.0 with nvm:

$ nvm use lts/carbon

Install composer dependencies:

$ composer install

Install Node dependencies with Yarn:

$ yarn

Build your project with yarn:

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 with npm:

$ npm install

Install Bower dependencies:

$ bower install

Build your project with Gulp

$ gulp

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

Join over 5,800 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?