User Guide / Sharing

Running in Production

Lookbook does not require any configuration changes to run in production. However it must be set up correctly so that it is loaded in both development and production environments.

Setup adjustments

1 Add gem to production group

Ensure Lookbook is added to the production group in your Gemfile.

# Gemfile
group :development, :production do
  gem "lookbook"
end

2 Mount the engine

The installation instructions include a check that the app is running in development before mounting the Lookbook engine. This code will need to be removed to run Lookbook in production.

# config/routes.rb
Rails.application.routes.draw do
  # if Rails.env.development? <-- remove
    mount Lookbook::Engine, at: "/lookbook"
  # end <-- remove
end

Watching for changes

File watching is disabled in production.

If using the actioncable and listen gems in development to enable live reloading, these can be omitted from the production gem group.

User Guide

Extending Lookbook

API

Elsewhere