Build and tests
The bundler runs as goals of the webforJ build plugin. Add the plugin once, as shown there, and a normal mvn package or gradle build produces an app with its frontend compiled in, while mvn test runs the frontend tests alongside the Java tests. This page covers what the bundler does across those steps.
The development watch
The watch step is the one you run by hand during development, alongside the app. It compiles the frontend once, then rebuilds on every change and refreshes the browser.
mvn compile webforj:watch spring-boot:run
A webforJ project sets this as its default goal, so mvn with no arguments starts the watch and the app together. The reload behavior it drives, a stylesheet change applied in place against a script change that reloads the view, is covered in Frontend watch.
Frontend tests
The test step runs the Bun test runner over src/main/frontend during the test phase, so mvn test runs the frontend tests with the Java tests. When the source root holds no test files, the step is skipped, and a failing frontend test fails the build, so a broken frontend stops a release the same way a broken Java test does. For writing those tests, see Frontend testing.
Tuning a compiler
A compiler reads its settings from src/main/frontend/bun.config.ts, keyed by the extension id, so a setting reaches the right compiler with no flag on the build. See SCSS and Sass for a worked example that gives the SCSS compiler a load path.