node-gradle / node-gradle/gradle-node-plugin

Allow to set default NODE_PATH in extension for all NodeTasks

Open
#150 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Groovy
Stars
677
Forks
120
PR merge metrics
No merged PRs in 30d

Description

Use case: when building a Kotlin/JS project, the Gradle plugin will create in rootProject build/js a yarn environment with all required modules in all subprojects (which is very handy). When running NodeTasks, it would be reasonable to set once NODE_PATH to said directory in NodeExtension and always rely on the Kotlin/JS dependency resolution.

And/or provide an extension like:

fun NodeTask.setNodeModulesPath(path: String) =
    environment.put("NODE_PATH", path)

fun NodeTask.setNodeModulesPath(folder: File) =
    environment.put("NODE_PATH", path.normalize().absolutePath)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the NodeExtension and NodeTask entry points mentioned in the issue, then inspect how task environments are currently configured. Compare setting NODE_PATH at the extension level with the proposed task helpers; done means NodeTasks consistently use the configured path without requiring repeated configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, kotlin, nodejs
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.