Watch mode and clipboard
Watch one variation
pnpm start 0 # watches v1
pnpm start 1 # watches v2
pnpm start 2 # watches v3The numeric argument is zero-indexed and follows discovered variation order: numeric vN folders first, then named folders such as control. With only v1 and control, pnpm start 1 watches src/js/control/index.jsx.
Internally, pnpm start 0 delegates to the package-owned exp-start binary, which runs the build watcher with:
exp-build --watch -e0The -e0 flag selects the first discovered variation and enables clipboard copying after successful builds.
Clipboard copy
On every save, the IIFE bundle is automatically copied to your clipboard:
| OS | Tool used |
|---|---|
| macOS | pbcopy (built-in) |
| Linux | xclip -selection clipboard |
| Windows | clip (built-in) |
If the clipboard tool is unavailable, the build still succeeds. Copy the bundle from dist/v1-index.jsx instead.
Linux: install xclip
# Ubuntu / Debian
sudo apt-get install xclip
# Arch
sudo pacman -S xclipPasting into Adobe Target
- Open the custom code editor for the variation you are developing.
- Switch to your terminal. The clipboard already contains the latest bundle.
- Select all existing content in the code editor and paste.
- Click Save in Adobe Target and refresh your preview page.
How the bundle works
The IIFE bundle registers under window.sgd, or the namespace you chose. Adobe Target accepts the bundle as raw JavaScript and does not need a module loader.
Watching all variations
To rebuild all variations on every save without clipboard copy:
pnpm devUse pnpm dev when you want to verify that all variations build cleanly. Use pnpm start N when actively iterating on a single variation.
Lint behavior
Watch mode runs Biome on every rebuild. A lint error blocks that bundle but keeps the watcher alive so saving a fix retries automatically.
Production pnpm build exits immediately when the lint gate fails.