Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Build Status Code Climate dependency Status devDependency Status



All Mac installation instructions assume you already have Homebrew installed.

Install nvm

# From
curl -o- | bash

Install OpenStax Webview

git clone
cd os-webview

Build and Run the Development Server

To build the site for development and load it in your default web browser with BrowserSync, simply run:

. script/bootstrap

That will create a new dev directory from which the site is served. Changes should be made to files in the src directory. Gulp will automatically watch for changes in src, perform any compilation and transpilation necessary, and update the result in dev.

You can also run individual tasks. Enter $(npm bin)/gulp --tasks to see the full list.


To run the linters and unit tests locally, enter:


You can also just run the linters ($(npm bin)/gulp lint) individually without rebuilding.

Note: The unit tests require the dev build to be built (in the dev directory).

Build for Production

./script/build production

You must configure your web server to host the files in the dist directory that gets created. No special configuration is required, although it is highly recommended to serve the site using HTTP/2.


The API_ORIGIN environment variable can be used to specify which CMS instance is used by os-webview. os-webview settings are loaded from the specified CMS instance's webview-settings API. The default API_ORIGIN for script/dev is

Upgrading Dependencies

You can upgrade dependencies manually or you can upgrade all of them by running ./script/upgrade && ./script/test.

Updating Version

The version must be updated in each release to help prevent browser caching issues. The version is updated in 3 locations.

  1. version.js Update the constant.
  2. index.html Update the version on reference to main.css and bundle.js
  3. package.json Update the version element