Configuration

To configure pree, either provide params and options to the CLI:

pree build docs site -b repo

Or provide a config file:

# .pree.yml
src: docs
dest: site
base: repo

# 👆 running `pree build` with this config file
#    is equivalent to running the previous command.

A config file is normally a YAML file named .pree.yml located at working directory, but its name and address can also be configured. The config file is treated as a convenient default, any options provided to the CLI will override the config file.

Config & CLI Options
Config CLI Description

src

first param

The source of website content.
Either an HTML file or a directory.

CLI Example
pree view docs
Config Example
src: docs

dest

second param

The destination of the built website.
Either an HTML file or a directory.

CLI Example
pree build docs site
Config Example
src: docs
dest: site

base

-b, --base

The base path of the website.

CLI Example
pree build docs site -b repo
Config Example
base: repo

inject base

--inject-base

Automatically inject the base path into HTML files.
Defaults to false.

Only use this options if you want to deploy
your website to multiple hosts with different
base paths. Otherwise explicitly include a
<base> tag in your HTML files.

CLI Example
pree build docs site -b repo --inject-base
Config Example
base: repo
inject base: true

include

-i, --include

A glob pattern to include files for build.

For multiple patterns, use multiple -i flags,
or provide an array in the config.

CLI Example
pree build -i "**/*.final.html"
Config Example
src: docs
include: "**/*.final.html"

exclude

-e, --exclude

A glob pattern to exclude files from build.
Defaults to ['**/_*', '**/.*'].

For multiple patterns, use multiple -e flags,
or provide an array in the config.

CLI Example
pree build -e "**/*.draft.html"
Config Example
src: docs
exclude: "**/*.draft.html"

port

-p, --port

The port to serve the website on.
By default will pick a random available port.

CLI Example
pree view -p 8080
Config Example
port: 8080

prod

-P, --prod

View the website in production mode.
Disables build env access.

CLI Example
pree view -P
Config Example
prod: true

concurrency

-C, --concurrency

The number of concurrent pages to build at once.
Defaults to 16.

CLI Example
pree build -C 8
Config Example
concurrency: 8

root

-r, --root

The root path of the website.
Defaults to src.

CLI Example
pree view -r path
Config Example
root: path

logLevel

The log level of the CLI.
One of debug, info, warn, error, silent.
Defaults to info.

Config Example
logLevel: debug

-c, --config

The path to the config file.
Defaults to .pree.yml.

CLI Example
pree build -c preeconf.yml

-V, --verbose

Show verbose output.

CLI Example
pree build -V

-S, --silent

Silent mode.
Use multiple times to silence more.

CLI Example
pree build -SS


pree logo