@turbo-player/build-variant-list
v1.1584.0
Published
CLI tool to build variant lists for turbo player
Downloads
996
Keywords
Readme
@turbo-player/build-variant-list
A command-line tool (CLI) to build and generate variant manifests/lists for the turbo player integration.
This tool uses Puppeteer under the hood to crawl or render the player configurations and export the built variant profiles.
Installation
You can install this package from NPM like this:
# Using npm
npm install @turbo-player/build-variant-list
# Using pnpm
pnpm add @turbo-player/build-variant-listUsage
This package exposes a CLI executable named build-variant-list.
Command Line
build-variant-listEnvironment Variables
The CLI configures itself dynamically using the following environment variables:
VARIANTS_MANIFEST: Path to the local compiled variants manifest file (e.g.,./build/variants-manifest.js).INTEGRATION_TAG: The integration tag identifier (e.g.,my-integration).JS_FILE: The entry JavaScript filename (e.g.,integration.js).OUTPUT_FILE: Path where the generated JSON list should be written (e.g.,./build/variant/list.json).
Example Integration Script
Typically, this tool is run as part of a post-build lifecycle hook in a monorepo setup:
"scripts": {
"build:variant-list": "VARIANTS_MANIFEST=./build/variants-manifest.js INTEGRATION_TAG=my-integration JS_FILE=integration.js OUTPUT_FILE=./build/variant/list.json pnpm exec build-variant-list"
}License
This project is licensed under the MIT License.
