# How to generate js file for each class?

**URL:** <https://discuss.kotlinlang.org/t/how-to-generate-js-file-for-each-class/3593>\
**Category:** Uncategorized\
**Created:** [July 3, 2017, 12:48am UTC](https://discuss.kotlinlang.org/t/how-to-generate-js-file-for-each-class/3593 "2017-07-03T00:48:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonyemu](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tonyemu](https://discuss.kotlinlang.org/u/tonyemu)\
**Post date:** [July 3, 2017, 12:48am UTC](https://discuss.kotlinlang.org/t/how-to-generate-js-file-for-each-class/3593/1 "2017-07-03T00:48:36Z")

</div>

Hello ,I use kotlin to build the front-end,but I found all of the kt file are compiled  
into one js file that will very big final !

---

<div class="post-metadata">

**Author:** ![Alexey.Andreev](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Alexey.Andreev](https://discuss.kotlinlang.org/u/Alexey.Andreev)\
**Post date:** [July 3, 2017, 8:25am UTC](https://discuss.kotlinlang.org/t/how-to-generate-js-file-for-each-class/3593/2 "2017-07-03T08:25:36Z")

</div>

Kotlin does not support file-to-file compilation. How big is your JS file? How many classes are in your project?

---

<div class="post-metadata">

**Author:** ![tonyemu](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@tonyemu](https://discuss.kotlinlang.org/u/tonyemu)\
**Post date:** [July 3, 2017, 9:40am UTC](https://discuss.kotlinlang.org/t/how-to-generate-js-file-for-each-class/3593/3 "2017-07-03T09:40:00Z")

</div>

Thank you!  
There are 58 classes in my project. And the JS file size is 1.2MB.  
It will spare a long time to load the JS file when I request every page at first.
