# How to use multiple JS modules

**URL:** <https://discuss.kotlinlang.org/t/how-to-use-multiple-js-modules/412>\
**Category:** Uncategorized\
**Created:** [November 13, 2014, 7:47pm UTC](https://discuss.kotlinlang.org/t/how-to-use-multiple-js-modules/412 "2014-11-13T19:47:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobNik](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@RobNik](https://discuss.kotlinlang.org/u/RobNik)\
**Post date:** [November 13, 2014, 7:47pm UTC](https://discuss.kotlinlang.org/t/how-to-use-multiple-js-modules/412/1 "2014-11-13T19:47:26Z")

</div>

Hi,

I’d like to create a reusable library of Kotlin-compiling-to-JS. In my first attempt, I included the library module in my project, as an imported module. When I build my project I get separate .js files for the two JS modules. Is there a way to compile everything into one .js file?

thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![bashor](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/bashor/32/1431_2.png) [@bashor](https://discuss.kotlinlang.org/u/bashor)\
**Post date:** [November 13, 2014, 8:06pm UTC](https://discuss.kotlinlang.org/t/how-to-use-multiple-js-modules/412/2 "2014-11-13T20:06:54Z")

</div>

We don't have standard way for that. Use external tools(e.g. closure-compiler). In IDEA You can setup [artifact and use "post-processing"](https://www.jetbrains.com/idea/help/post-processing-tab.html) or use [File Whatcher](https://www.jetbrains.com/idea/help/using-file-watchers.html)
