Skip to content
This repository was archived by the owner on Oct 13, 2024. It is now read-only.

How to Provide Configuration

samhuk edited this page Mar 15, 2023 · 5 revisions

Introduction

The Exhibitor CLI allows you to customize the behavior of various commands, such as start and demo.

Configuration is provided via a file. Certain properties can be overridden by CLI command arguments.

File paths defined in a configuration file are relative to the path of the configuration file.

If difficulties are encountered whilst providing configuration for the Exhibitor CLI, try enabling verbose mode by adding the --verbose command argument. For example: npx exhibitor start --config="./exh.config.json" --verbose. This will print a detailed list of steps that Exhibitor CLI is performing.

See the Configuration Reference for what options exist.

Creating a Configuration File

Configuration can be defined as either a JSON, Javascript, or Typescript file.

Start by creating a configuration file of either type:

JSON

Defining configuration as JSON is optimal for simple uses of Exhibitor or if the extra capabilities that Javascript/Typescript provides is not required.

{
  "$schema": "https://raw.githubusercontent.com/samhuk/exhibitor/master/src/common/config/schema.json",
  "rootStyle": "./styles.scss",
  "site": {
    "port": 4002,
    "title": "Test Component Library"
  },
  "verbose": true
}

Javascript

module.exports = {
  rootStyle: './styles.scss',
  site: {
    port: 4001,
    title: 'My Component Library',
  },
  verbose: true,
}

Typescript

import { Config } from 'exhibitor'

const config: Config = {
  rootStyle: './styles.scss',
  site: {
    port: 4001,
    title: 'My Component Library',
  },
  verbose: true,
}

export default config

Supplying a Configuration File

Your configuration file can be supplied to the Exhibitor CLI like so:

npx exhibitor start --config="./exh.config.json"
npx exhibitor start -c "./exh.config.json"
npx exhibitor start -c "./exh.config.ts"

Next Steps

See the Configuration Reference for what configuration options exist.

Clone this wiki locally