kotlin-compiler-server icon indicating copy to clipboard operation
kotlin-compiler-server copied to clipboard

Webpack bundle support

Open rjaros opened this issue 5 years ago • 11 comments

Any chance of supporting Kotlin/JS features like bundling code with webpack?

rjaros avatar Jan 22 '20 21:01 rjaros

Hello! Thanks for the feedback. Could you please add a little bit more description of that feature? It's a feature for Kotlin JS team or for this repository?

Thanks.

AlexanderPrendota avatar Jan 23 '20 11:01 AlexanderPrendota

As far as I understand webpack integration is part of the new Kotlin/JS gradle plugin. I'm not quite sure how it relates to the Kotlin/JS compiler or to this project.

rjaros avatar Jan 23 '20 11:01 rjaros

So, that is a good feature request. But Actually, I don't have plans to implement that feature but you could create an issue in Kotlin and maybe someone could help you.🙂

AlexanderPrendota avatar Jan 23 '20 15:01 AlexanderPrendota

I think I'll try to play with your project, because I think it could be done with not much effort. I'll make a PR if I succeed.

rjaros avatar Jan 23 '20 16:01 rjaros

Thanks. I will be waiting for your PR 😊

AlexanderPrendota avatar Jan 24 '20 08:01 AlexanderPrendota

I've opened a PR (#37). I've tested it successfully with my KVision framework (with a lot of npm dependencies from framework jar's). I would like to add Kotlin DCE support as well, but currently I have no idea if it's possible without Kotlin/JS gradle plugin.

rjaros avatar Jan 27 '20 12:01 rjaros

Hello! Thanks for your PR. I need more time to have a look at it. 😊 (Currently, I'm working on creating a docker image and making configuration for starting the application as Amazon Lambda Function)

Also, probably that feature might be interesting for @gzoritchak and @calvellido. (sorry for disturbing)

AlexanderPrendota avatar Jan 27 '20 12:01 AlexanderPrendota

Indeed! Thanks, let me know if I can lend a hand :+1:

calvellido avatar Jan 28 '20 11:01 calvellido

@rjaros could you please provide more about your usecases? Also, answer a few questions

  1. How are you going to use it?
  2. Should it be configurable by external users?
  3. If so, how and which parts?

bashor avatar Feb 03 '20 14:02 bashor

@gzoritchak @calvellido please feel free to share your thought too.

bashor avatar Feb 03 '20 14:02 bashor

I would like to create an online playground app (kind of jsfiddle) for my framework (https://github.com/rjaros/kvision). I want to send a portion of Kotlin code from the user code editor to the service and get back a bundle.js file which can be used with a simple index.html file.

I think the current available configuration is fine (adding kotlinJsDependency in build.gradle.kts with external Kotlin/JS libraries). With my PR you can also configure webpack processing with webpack.config.*.js and package.json files. For my usecase I don't need additional configuration (e.g. with API parameters).

rjaros avatar Feb 03 '20 14:02 rjaros