ihub-node
...Less than 1 minute
ihub-node
plugin information
ihub-node
plugin is a stand-alone plugin based on com.github.node-gradle.node plugin supports building node.js projects, and extension supportcnpm
Plugin Id | Plugin Name | Plugin Type | Extension Name | Plugin dependencies |
---|---|---|---|---|
pub.ihub.plugin.ihub-node | GitHooks Plugin | Project [^Project] | iHubNode | com.github.node-gradle.node |
Extended Properties
Extension | Description | Default | Ext[^Ext] | Prj[^Prj] | Sys[^Sys] | Env[^Env] |
---|---|---|---|---|---|---|
version | Node.js Version | latest | ✔ | ✔ | ✔ | ❌ |
npmVersion | npm version. If not specified, use Node.js bound version | latest | ✔ | ✔ | ✔ | ❌ |
pnpmVersion | pnpm version, latest version if not specified | latest | ✔ | ✔ | ✔ | ❌ |
yarnVersion | pnpm version, latest version if not specified | latest | ✔ | ✔ | ✔ | ❌ |
cnpmVersion | pnpm version, latest version if not specified | latest | ✔ | ✔ | ✔ | ❌ |
distBaseUrl | Node.js Download Address | ❌ | ✔ | ✔ | ✔ | ❌ |
allowInsecureProtocol | Whether unsafe protocols are allowed | false | ✔ | ✔ | ✔ | ❌ |
download | Whether to download and install specific Node.js versions | false | ✔ | ✔ | ✔ | ❌ |
workDir | Node.js Installation Directory | ❌ | ✔ | ✔ | ✔ | ✔ |
npmWorkDir | NPM installation directory | ❌ | ✔ | ✔ | ✔ | ✔ |
pnpmWorkDir | NPM installation directory | ❌ | ✔ | ✔ | ✔ | ✔ |
yarnWorkDir | Yarn Installation Directory | ❌ | ✔ | ✔ | ✔ | ✔ |
cnpmWorkDir | cNpm installation directory | ❌ | ✔ | ✔ | ✔ | ✔ |
Plugin Installation
Kotlin
plugins {
id("pub.ihub.plugin.ihub-node")
}
Groovy
plugins {
id 'pub.ihub.plugin.ihub-node'
}
Example plugin configuration usage
Kotlin
iHubNode {
version.set("18.16.0")
}
Groovy
iHubNode {
version = '18.16.0'
}
Plugin Extension Task
cnpm
Task Extension Configuration
Kotlin
import pub.ihub.plugin.node.cnpm.task.CnpmTask
tasks.create("cnpm_run_dev", CnpmTask::class) {
args.set(listOf("run", "dev"))
}
Groovy
task cnpm_run_dev(type: pub.ihub.plugin.node.cnpm.task.CnpmTask) {
args = ['run','dev']
}
Task command
cnpm run dev
cnpmSetup
Task command
npm install --global --no-save --prefix cnpm --registry=https://registry.npm.taobao.org
cnpmInstall
Task command
cnpm install
cnpmSync
Task command
cnpm sync cnpmcore