gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Respect gradle offline mode

Open Nossnevs opened this issue 5 years ago • 2 comments

Right now gradle-node-plugin ignores gradle offline mode and contacts the registry anyway.

The expected behavior is that it uses the local node_modules and perhaps using the npm offline flag. It should not fail with not being able to connect to internet.

Nossnevs avatar Jan 16 '20 10:01 Nossnevs

This isn't really up to gradle-node-plugin, it simply asks npm to install, if everything is installed already the task is up-to-date and npm is not even invoked.

Now let's say we do run in an offline "offline" mode, at that point there'd be no way for npm to install the modules because network traffic would fail and the build would fail. If you want something similar to this you can configure the task and have it be skipped if gradle is offline.

With this in mind, to me this is the expected behaviour, but if you can make a case for having it work differently we can probably add some logic for behaving better when running --offline, a flag which only exists in gradle afaict.

deepy avatar Jan 16 '20 11:01 deepy

sigh it's in the configuration, but you can't easily find it with a search engine because everyone is publishing packages called some mix of "install", "offline" and an additional word.

deepy avatar Jan 23 '20 09:01 deepy