Skip to content

Watch mode and clipboard

Watch one variation

bash
pnpm start 0   # watches v1
pnpm start 1   # watches v2
pnpm start 2   # watches v3

The 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:

bash
exp-build --watch -e0

The -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:

OSTool used
macOSpbcopy (built-in)
Linuxxclip -selection clipboard
Windowsclip (built-in)

If the clipboard tool is unavailable, the build still succeeds. Copy the bundle from dist/v1-index.jsx instead.

Linux: install xclip

bash
# Ubuntu / Debian
sudo apt-get install xclip

# Arch
sudo pacman -S xclip

Pasting into Adobe Target

  1. Open the custom code editor for the variation you are developing.
  2. Switch to your terminal. The clipboard already contains the latest bundle.
  3. Select all existing content in the code editor and paste.
  4. 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:

bash
pnpm dev

Use 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.

Internal tool - Samsung / Sogody experimentation team

Help improve the frameworkShare an idea or friction you encountered.Share framework feedback(opens in a new tab)