Is there a way to use two kotlin/js projects with ...
# javascript
i
Is there a way to use two kotlin/js projects with browser target so the first has the second as a dependency, but I would want to have them connected maybe like modules in IntelliJ project structure to work with it like with one project, so if I change something in the second and do module build in first it would work automatically ?
d
You can have multiple gradle subprojects, each set up as kotlin/js browser projects, and then one project can depend on the other project
i
Are you talking about submodules in gradle ?
d
Yes
i
I don’t want them to be gradle submodules. I have a library and let’s say 10 different projects which use it, I would need to be able to open any of these projects with this library in one idea and work with it as if they would be submoduls
l
If you want them to live in different projects, you can publish to maven local. Then add it as a dependency in the other projects, making sure to add mavenLocal as a repository.
i
Actually it’s the only idea I have, but when I used maven it worked without publishing to mavenlocal, IntelliJ just knew that my dependency is opened in the same window and compiled that code
a
it sounds like you want composite builds? So you can have a Gradle project and use another (independent) Gradle project as a dependency. IntelliJ understands composite builds, so it will show both projects in one IntelliJ instance
1
t
Is it for workers?
i
Workers ?
Service workers ?
t
I use custom Gradle configuration to link subprojects
I use it for Web Workers
KFC
application
plugin search project dependencies with
jsMainModule
configuration and link compile tasks. Code
Do you need something similar?
i
Probably, but would be ideal without need of writing own plugin
t
Do you use second subproject as additional Webpack entry point?
i
No ?
Composite build does the trick, thanks !