If I add coroutines to my project the resulting bu...
# javascript
h
If I add coroutines to my project the resulting bundle is too big and webpack issues a warning in the JS console, even if I add the DCE plugin. Not sure what webpack configuration I need to fix that. Any suggestions?
r
Hi, what size of before/after DCE?
h
1.6 mb vs 392 kb
I am using coroutines in this project
This is my build.gradle for the project.
r
Is that size of webpack bundle?
h
yep
r
Is webpack minifier turned on?
h
That is the configuration I'm looking for
r
FYI: It would be great if you move from deprecated frontend plugin to https://mvnrepository.com/artifact/org.jetbrains.kotlin.js/org.jetbrains.kotlin.js.gradle.plugin
h
Ok. But then the compileKotlin2Js section doesn't work
I know nothing here is final/released, but I think there must be some documentation that is wrong
r
Yes, just use
compileKotlinJs
instead
h
Is there an example somewhere that shows the new plugin?
r
You should create a directory with name
webpack.config.d
next to build.gradle and put config there
h
but that uses the frontend plugin?
r
Yes, this is to fix your current issue. Moving from FE plugin is rather recommendation.
h
so same config, just different plugin?
r
If I got you the FE plugin is used, so your issue with size of final bundle should be fixed for FE plugin. The possible solution is using additional minifier in webpack.
Moving to new kotlin js gradle plugin is recommendation. I will post example for it asap, please wait a bit
Probably this repo might help you with new plugin. https://github.com/mkraynov/kfsad/tree/kotlin-1.3.40-preview
h
Ah, thanks. That looks more helpful
Where is the source code for the plugin? Would make it easier to figure out what configurations are supported.
b
In npm block sed mode production. This minifies the bundle
That's for the old plugin ofc
h
Yeah, I want to use the new plugin
not that I get the new plugin to work very well either
b
I'd wait until they publish the documentation for it
h
but that’s no fun 🙂
😄 1
s
@Hellcat Did this resolve things? I’m curious to know what size you ended up with.
h
Nope. Didn’t solve it yet. I was hoping the new plugin would help, but no success there either. Postponing this for now. I got some other more urgent stuff I need to fix