@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
Terminal
ut install @utoo/pack-cli --save-devUsage
Development
Start the development server with HMR:
Terminal
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 |
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 |
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.
Example
utoopack.json
{
"$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
package.json
{
"scripts": {
"dev": "up dev",
"build": "up build"
}
}Terminal
ut dev
ut buildLast updated on