https://kotlinlang.org logo
#javascript
Title
# javascript
v

Vampire

01/31/2023, 4:00 PM
What are pros and cons of
kotlin.js.ir.output.granularity
whole-project
vs.
per-module
?
t

turansky

01/31/2023, 4:34 PM
whole-program
1. More optimal bundle 2. Ready bundle if you don’t use additional NPM libraries 3. Transparent possibility to use other Kotlin/JS subprojects in dynamic imports 4. Slower build?
per-module
1. Faster build?
v

Vampire

01/31/2023, 11:34 PM
So I got you right, that you would prefer
whole-program
? Or are you a speed junkie? 😄 And under the premise that I send it through ncc and thus webpack which should neglect 1., I use other NPM libs which neglects 2., and I don't split the project into multiple projects (it's anyway just 2 classes) which neglects 3. Then still? 🙂
t

turansky

02/01/2023, 1:32 AM
Then still? 🙂
Yes
v

Vampire

02/01/2023, 1:32 AM
Why, if only slower build is left over? 😄
I'm really curious, as you for sure have some reason :-)
t

turansky

02/02/2023, 5:37 PM
whole-program
is transparent - it is what I understand All Kotlin code in one bundle for better DCE!
File to file is also fine, but it's not supported right now Goal - app with multiple entry points
Per module - in simple cases it has no sense. I see only usages without DCE usage :(
v

Vampire

02/02/2023, 5:53 PM
Ok, thanks for your thoughts :-)
53 Views