vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
  • bugs
  • build
  • cache
  • ci
  • config
  • create
  • deploy
  • docs
  • exec-cache
  • exec-local
  • exec
  • help
  • init
  • install
  • list
  • login
  • logout
  • outdated
  • pack
  • ping
  • pkg
  • publish
  • query
  • registry
  • repo
  • run-exec
  • run
  • setup
  • skills
  • token
  • uninstall
  • version
  • view
  • whoami
  • What ends up in the target
  • Lifecycle scripts
  • Limitations
  • Options
  1. Client
  2. /
  3. Commands
  4. /
  5. deploy

vlt deploy

Usage:

Terminal
$ vlt deploy <target-dir>

Copy a workspace, or a project without workspaces, and its production dependencies into a standalone folder, ready to ship, for example in a Docker image. It works like pnpm deploy.

Terminal
# From the project root
$ vlt deploy -w apps/api ./dist/api

# From inside the workspace folder

$ cd apps/api && vlt deploy ../../dist/api

What ends up in the target

  • The workspace's files, selected the same way vlt pack selects them (the files field, .npmignore or .gitignore). Build the workspace before deploying it: no lifecycle scripts run.
  • Its package.json without devDependencies.
  • Every workspace it depends on, copied as a real folder into .vlt-deploy/ inside the target. Nothing in the target links back to the project, so the folder can be copied or moved on its own.
  • A node_modules folder with the production dependencies, and the vlt.json and vlt-lock.json it was installed from.

Dependencies are installed from the project's vlt-lock.json, so the target gets the exact versions the project uses. vlt deploy fails if the lockfile is missing or out of date: run vlt install in the project first.

Dockerfile
FROM node:22-slim
COPY dist/api /app
WORKDIR /app
CMD ["node", "index.js"]

Lifecycle scripts

Like vlt install, vlt deploy runs no lifecycle scripts of dependencies unless allowed with --allow-scripts. The query is saved to the target's vlt.json, so vlt build in the target uses it too.

Terminal
$ vlt deploy -w apps/api ./dist/api --allow-scripts="#esbuild"

Limitations

  • Only one workspace is deployed at a time.
  • file: dependencies are not supported.

Options

FlagDescription
--workspace=<path>The workspace to deploy, inferred inside a workspace folder
--workspace-group=<name>Deploy the workspace in this group; it must select exactly one
--allow-scripts=<query>Allow matching packages to run lifecycle scripts
--forceRemove the contents of the target folder if it is not empty

PreviouscreateNextdocs

On this page

  • What ends up in the target
  • Lifecycle scripts
  • Limitations
  • Options
Edit this page

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now