Kotlin / kotlin-frontend-plugin

Gradle Kotlin (http://kotlinlang.org) plugin for frontend development
Apache License 2.0
563 stars 69 forks source link

Cannot change the node_modules location? #108

Open ghost opened 6 years ago

ghost commented 6 years ago

Right now the node_modules is placed inside build, this is not convenient when we use our favorite frameworks, the IDE does not point there for node_modules hence it constantly says the module is not installed... Is there a way to tell the npm to place node_modules in the root dir of the module itself like any normal npm project? Also, the package.json is inside build... why? Otherwise, how do we tell IntelliJ to point to build/node_modules instead to help us with autocompletion?

wem commented 6 years ago

As all npm, Karma etc. files are generated by Gradle i think it makes sense to place them within Gradle build dir. You need autocompletion for JS code? Whats the use case? Afaik this plugin targets builds with Kotlin on top of JS. So you better make your own wrapper as mentioned here eg. https://kotlinlang.org/docs/reference/js-modules.html, so you will get autocompletion on Kotlin level.

ghost commented 6 years ago

You can have a kotlin-js project with 2 entries, one for kotlin, one for plain .js all together bundled. I get your point, but not for every part of the app it is practical to use kotlin transpiled. As it is now, it looks like it's siloed there in the build. What about allowing some flexibility on this? just saying... Suppose I want to use XYZ.js without having to write all the wrappers, but still have the power of kotlin for other parts of the app. Then let XYZ.js talk with kotlin only where it's necessary.