Bootstrapping
These plugins are available from the plugin portal.
Add the appropriate plugin identifiers to your build.gradle
file depending on the type of functionality you require.
plugins {
id 'org.ysb33r.nodejs.base' version '4.0.0' (1)
id 'org.ysb33r.nodejs.npm' version '4.0.0' (2)
id 'org.ysb33r.nodejs.gulp' version '4.0.0' (3)
id 'org.ysb33r.nodejs.cmdline' version '4.0.0' (4)
id 'org.ysb33r.nodejs.wrapper' version '4.0.0' (5)
id 'org.ysb33r.nodejs.dev' version '4.0.0' (6)
}
1 | Base plugin |
2 | Support for using NPM |
3 | Support for using Gulp |
4 | Support running commands like node from the command-line with arguments. See running commands from command-line. |
5 | Create wrappers for node , npm and npx . See creating wrappers. |
6 | Use Gradle to manage your Node.js project development. |
Base plugin
The base plugin provides:
-
nodeexec execution extension.
-
Ability to download and use Node distributions.
NPM plugin
The NPM plugin provides:
-
NpmTask type.
-
npmexec
project extension to run NPM commands. -
npm
,npmDevOnly
,npmOptional
,npmPeer
configurations. -
npmPackage
for listing packages in Gradledependencies
blocks. -
NpmExecSpec
.
Applying the NPM plugin will apply the base plugin.
Gulp plugin
The Gulp plugin provides:
-
gulp
project and task extensions -
GulpTask
task type.
Applying the Gulp plugin will apply the NPM plugin.
Other quick starts
-
I want to run a tool built in Node, but I don’t want to node Javascript development: Using a Javascript-based tool.
-
I want to wrap an existing Javascript tools and present it as part of a plugin: Wrapping NPM packages.
-
I want to manage my Javascript project with Gradle: Developing with Node.js.