Skip to Content

@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-dev

Usage

Start the development server with HMR:

Terminal
utx up dev

Commands

up build

Build the project for production.

OptionDescription
-p, --project <path>Set the project path
-r, --root <path>Set the root path
--webpackEnable webpack compatibility mode
--tracing, --no-tracingShow or hide compilation progress; defaults to tracing from the config file, otherwise on

up dev

Start the development server with HMR on port 3000.

OptionDescription
-p, --project <path>Set the project path
-r, --root <path>Set the root path
--webpackEnable webpack compatibility mode
--tracing, --no-tracingShow or hide compilation progress; defaults to tracing from the config file, otherwise on

Configuration

The CLI looks for configuration files in the following order:

  1. utoopack.json
  2. utoopack.config.mjs
  3. utoopack.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

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 build
Last updated on