Frontend Gradle plugin - Integrated Node.js, npm, Yarn builds Latest release 6.0.0

This plugin allows to integrate into Gradle a build based on Node.js/npm/Yarn. It is inspired by the philosophy of the Frontend Maven plugin, an equivalent plugin for Maven. Follow the quick start guide, and build your frontend application. Take a look at the Release notes if you are migrating from a previous version.


Distribution management

The plugin downloads and installs a Node.js distribution. When required, the plugin may also trigger the install of a Yarn distribution relying on the Berry baseline. This means that both Yarn 1 and Yarn 2+ distributions are supported. Optionally, a shared/global Node.js distribution may be used instead to avoid network overhead and duplication. The plugin may also use a HTTP proxy server when downloading the Node.js distribution, to take advantage of any caching facility, and submit to the organization's security rules. Basic authentication scheme is supported for both distribution and proxy servers.

Configurable dependencies installation

Depending on the environment, installing frontend dependencies using the package.json file may require a different command (e.g. npm ci).

Built-in tasks

No need to define tasks to build, clean, check, or publish the frontend application through Gradle lifecycle. The plugin provides ready-to-use tasks out of the box, and ensures their implementation matches Gradle's recommandations. Plug scripts from a package.json file with the DSL, and run gradlew build.


For more complex use cases, the plugin provides types to create tasks and run custom commands with Node.js, npm, npx, Yarn.

Under the hood
  • Lazy configuration: tasks configuration is delayed until necessary thanks to the use of Gradle lazy configuration API, to optimize performance of builds and ease chaining tasks I/O.
  • Self-contained domain design: the plugin design is influenced by clean coding principles. The domain layer is isolated from any framework and infrastructure. Writing cross-platform unit tests and maintaining the plugin is easier. Code coverage and predictability increase.