@utoo/pack-cli
Command-line interface for @utoo/pack, the high-performance bundler powered by Turbopack .
@utoo/pack-cli provides the up CLI binary for building and serving projects using @utoo/pack. It reads configuration from utoopack.json, utoopack.config.mjs, or utoopack.config.js.
Installation
ut install @utoo/pack-cli --save-devUsage
Development
Start the development server with HMR:
utx up devCommands
up build
Build the project for production.
| Option | Description |
|---|---|
-p, --project <path> | Set the project path |
-r, --root <path> | Set the root path |
--webpack | Enable webpack compatibility mode |
--tracing, --no-tracing | Show or hide compilation progress; defaults to tracing from the config file, otherwise on |
up dev
Start the development server with HMR on port 3000.
| Option | Description |
|---|---|
-p, --project <path> | Set the project path |
-r, --root <path> | Set the root path |
--webpack | Enable webpack compatibility mode |
--tracing, --no-tracing | Show or hide compilation progress; defaults to tracing from the config file, otherwise on |
Configuration
The CLI looks for configuration files in the following order:
utoopack.jsonutoopack.config.mjsutoopack.config.js
See @utoo/pack Configuration for full configuration options.
Runtime fields such as processEnv, watch, dev, buildId, tracing, packPath, projectPath, and rootPath are read from the same file; --project and --root take precedence over projectPath and rootPath.
Before building, the CLI fills in a few defaults: persistentCaching is enabled unless set explicitly, and for production builds (mode is not development and dev is not true) optimization.concatenateModules, optimization.removeUnusedExports, and optimization.removeUnusedImports default to true.
Example
{
"$schema": "@utoo/pack/config_schema.json",
"entry": [
{
"import": "./src/index.ts",
"html": {
"template": "./index.html"
}
}
],
"output": {
"path": "./dist",
"filename": "[name].[contenthash:8].js",
"chunkFilename": "[name].[contenthash:8].js",
"clean": true
},
"sourceMaps": true
}package.json Scripts
{
"scripts": {
"dev": "up dev",
"build": "up build"
}
}ut dev
ut build