This library provides an environment for developing templates that will run on the FanConnect platform.
- Node.js >= 16.17.0
This is the recommended approach as it allows you to control the version used more easily:
# npm
npm install --save-dev @fanconnecttv/preview
# yarn
yarn add -D @fanconnecttv/preview
At this point you can run the previewer via:
# npm
npx preview
# yarn
yarn preview
With npx
you can run the previewer without declaring it as a dependency. It is recommended to use
@latest
to avoid using older cached versions:
npx @fanconnecttv/preview@latest
Option | Type | Default | Description |
---|---|---|---|
-d /--dir
|
string | ${PWD}/dist |
Directory containing index.html |
-h /--help
|
boolean | false |
Display help message and exit |
-o /--open
|
boolean | false |
Open preview in default browser |
-p /--port
|
string | 1234 |
Port to listen on, if available |
-v /--version
|
boolean | false |
Print version and exit |
If the configured port is in use, an open port will be selected.
If -h
/--help
or -v
/--version
is specified, other options will be ignored.
By default, the previewer will look for index.html
in a directory called dist/
in the current
working directory.