Assets

lazy Dev Loop Integration

See how lazy ties JavaScript and public assets into the development loop.

By Guillermo Alvarez - Published - Updated

Start the app loop

Run the development server with:

lazy

For apps with js.toml, lazy runs JavaScript generation before the initial temporary Go build.

Regenerate JavaScript on changes

When these files change, the dev loop reruns the JavaScript pipeline before the Go rebuild:

app/js/
js.toml
package.json
package-lock.json

Changes under app/js can use the faster app-module bundling path. Manifest or package changes run the full lazy js flow, including dependency preparation. Package manager files are treated as content-sensitive inputs, so a no-op npm install touching package-lock.json does not schedule another rebuild.

Watch Tailwind separately

Tailwind runs as its own command during UI work:

lazy tailwind --watch

Keep the app loop running in another terminal:

lazy

When Tailwind rewrites app/public/styles.css, lazy sees the public file change, rebuilds the temporary app binary, restarts it, and reloads HTML pages.

Know what production needs

The dev loop does not replace production build steps. Before testing or building a production binary after asset changes, run the matching commands:

lazy tailwind
lazy js
go test ./...
go build -o .tmp/build/sample-app ./cmd/app

The generated public outputs are the files Go embeds into the binary.