We are having some trouble getting the new kotlinj...
# javascript
s
We are having some trouble getting the new kotlinjs plugin to pick up our .yarnrc file. Is it working for anyone else?
a
^ cc @Ilya Goncharov [JB]
i
What exactly problem? You can put
.yarnrc
in root project and it should be found
s
Even if its a submodule ?
I noticed that wording in the docs also so I am sure we did try that
i
Yes, it is necessary beacuse NPM project is based in root
build
folder, and because
.yarnrc
hierarchy find policy, it just go up and find this file. So from root
build
folder Yarn doesn’t find
.yarnrc
form submodule
s
Ok. I guess we will have another try.
i
Please tell about results Additionally, you can try to set
.npmrc
instead of
.yarnrc
Yarn is compatible with it
s
The project based part is counter intuitive to me. Can I ask why this is the case? Seems its breaking encapsulation of modules a bit
i
Initially main motivation is that because NPM dependencies. Gradle can’t work with NPM dependencies, so we manage it with npm package manager (Yarn in our case) It download dependencies in
node_modules
subfolder of
build
folder, so, if you clean project, it will be removed. And if we would setup npm project to each
build
separately, it will spend more time, and additionally it will spend more disk spaces (
node_modules
usually a big folder). So we decided to locate it in root
build
folder, but we understand such problem, and think how we can improve it.
s
Ok. In the past we have enjoyed the flexibilty of begin able to update and use separate versions in our various modules so it would suck to not have that going forward
(and we did get the .yarnrc working btw)
Thanks for the response !
m
I got the .yarnrc file working - thanks. A follow up question: In the /build/js folder, a yarn.lock file is generated. Is it possible to add that file somewhere in the source folders, so versions are locked?
i
It is only where build is located, you can mainly encapsulate your build logic in your submodules @Mranders there is issue. Main concern for now is that we install only dependencies, which is necessary for particular gradle build, and from one build to another in one project,
yarn.lock
can changed. So we need some setting which is responsible for “build all possible npm projects instead of lazily build only necessary packages”. In this case
yarn.lock
can be persisted, but for cold start it can spend more time
m
OK - thanks for the quick feedback