i have 4 modules with the frontend plugin and npm ...
# javascript
j
i have 4 modules with the frontend plugin and npm install is just killing me in terms of build time. 99% of the modules that each one are installing are the same. apparently node has a mechanism for concurrent locking during install, but there doesn't seem to be a way to pass
-g
for the install task. I would also just love to see project.buildDir changed to rootProject.buildDir (if the locking works). But global would be preferred for CI so that I could share the global installs across runs (similar to how Gradle stuff is in ~/.gradle)
4
s
But global install will install only one specific version of each module, no? Probably you need something like https://github.com/lerna/lerna
a
Which npm version are you using? Apparently npm should be able to set up a local cache since version 5.0.0. (https://docs.npmjs.com/cli/cache) Presumably that speeds things quite a bit, so it might be worth checking. The version kotlin-frontend plugin uses by default is pretty ancient (3.10.8), but it should be defaulting to your local npm installation.
a
I wonder if you have tried yarn. Yarn is considerably faster than using npm install directly.https://yarnpkg.com/en/
I've seen a 50% or better improvement in download times
a
That might be a good idea. Not sure if kotlin-frontend plugin supports yarn (cc @cy).
c
there is a PR for yarn support but it's abandoned unfortunately
j
I would be willing to attempt to rebase and finish the yarn PR if the author doesn't reply in a week or so. I'm also by no means an npm expert or yarn expert but npm doesn't seem to use the home directory cache in the same way as yarn. I'll keep playing with it.
c
I work with the guy who issued that pull request. I'll talk to him about getting it in shape again
Should be fixed now; feel free to go check it out!
👍 4
t
another option for fetching npm dependencies is this: https://github.com/craigburke/client-dependencies-gradle