Getting started
Requirements
The following tools must be installed to use the plugin:
- JDK 21 build: Gradle 8.5+
- JDK 17 build: Gradle 8.5+
- JDK 11 build: Gradle 8.5+
The plugin is built and tested on Linux, Mac OS, Windows (see the list of build environments used in the contributing notes).
Supported distributions
Steps
- Install the plugin.
Using Gradle DSL (recommended)
plugins { // For JDK 21+ id 'org.siouan.frontend-jdk21' version '9.0.0' // For JDK 17+ id 'org.siouan.frontend-jdk17' version '9.0.0' // For JDK 11+ id 'org.siouan.frontend-jdk11' version '9.0.0' }
Using Gradle build script block
buildscript { repositories { url 'https://plugins.gradle.org/m2/' } dependencies { // For JDK 21+ classpath 'org.siouan:frontend-gradle-plugin-jdk21:9.0.0' // For JDK 17+ classpath 'org.siouan:frontend-gradle-plugin-jdk17:9.0.0' // For JDK 11+ classpath 'org.siouan:frontend-gradle-plugin-jdk11:9.0.0' } } // For JDK 21+ apply plugin: 'org.siouan.frontend-jdk21' // For JDK 17+ apply plugin: 'org.siouan.frontend-jdk17' // For JDK 11+ apply plugin: 'org.siouan.frontend-jdk11'
- Define the
packageManager
property in thepackage.json
file. - Add
.frontend-gradle-plugin/
directory to.gitignore
file(s). - Configure the build, test (check), deploy (publish) phases in your project, with the help of the built-in tasks dependency tree and optionally examples provided for typical use cases.
- Run
gradlew build
. - Additionally:
- If you need to execute an instant command with a node-based executable (e.g. to install a dependency), invoke one of the following tasks on a Gradle command line:
runNode
,runCorepack
,runNpm
,runPnpm
,runYarn
. - If you need to define a reusable node-based command with eventual custom inputs, outputs, or environment, use one of the following task types:
RunNodeTaskType
,RunCorepackTaskType
,RunNpmTaskType
,RunPnpmTaskType
,RunYarnTaskType
. - If you need to run
node
/corepack
/npm
/pnpm
/yarn
executables from a command line (e.g. to start a development server), take a look at the FAQ.
- If you need to execute an instant command with a node-based executable (e.g. to install a dependency), invoke one of the following tasks on a Gradle command line: