Packing

Pack a built web app into a single .wvb bundle with wvb pack.

Packing turns a built web app into one .wvb file — the unit your app ships to its webview or uploads for over-the-air updates.

Pack a bundle

Run wvb pack against your build output directory. It reads every file under the source directory and writes a single compressed .wvb archive.

wvb pack                                    # uses config defaults
wvb pack ./dist                             # explicit source directory
wvb pack ./dist --outfile ./build/app.wvb   # explicit output path

The source directory defaults to pack.srcDir (or ./dist), and the output path defaults to pack.outFile. The .wvb extension is appended when you omit it. See wvb pack for every flag.

Name and version

The bundle name comes from your package.json name field with any scope prefix stripped. It sets the default output path, .wvb/<name>.wvb.

The version comes from your package.json version field. Packing does not embed it in the filename — the version is stamped when you upload the bundle or install it as a builtin.

Configure defaults

Set pack defaults in your wvb.config file so the command runs with no arguments.

wvb.config.ts
import { defineConfig } from '@wvb/config';

export default defineConfig({
  pack: {
    srcDir: './dist',
    outFile: '.wvb/app',
  },
});

outFile is a single output path — there is no separate outDir. A flag passed on the command line always overrides the config value. See Configuration for the full pack schema.

Ship as builtin

A packed .wvb can ship inside your native app as a builtin bundle, served when the app is offline or before it fetches a newer bundle over the air.

wvb builtin collects bundles into an output directory (default .wvb/builtin/bundles), laid out as <name>/<name>_<version>.wvb alongside a manifest.json.

On this page