srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
867 stars 210 forks source link

Add npmRegistry as first class citizen node config parameter #347

Open Nowheresly opened 4 years ago

Nowheresly commented 4 years ago

I was struggling the whole day trying to configure a specific npm registry in my build file (written in kotlin DSL) by following the instruction of the FAQ (written in Groovy DSL).

At the end, I'm wondering if this setting could deserve to be an official setting for the gradle-node-plugin.

In this PR, i just added the variable npmRegistry and updated the documentation accordingly.

Now, specifying an npm registry is as simple as this:

node {
   npmRegistry = 'https://myregistry.npm.com'
}

Do you think this PR could make sense? Thanks in advance for your time.

savinov commented 4 years ago

@Nowheresly do you have a workaround to specify NPM registry URL while your PR is in progress?

Nowheresly commented 4 years ago

@Nowheresly do you have a workaround to specify NPM registry URL while your PR is in progress?

Right now my workaround is to put in the buildSrc folder of my project the gradle-node-plugin with my PR. So I can easily specify my own npm registry. I could switch back to the official version of the plugin when my PR will be merged.