# What is the name of my Kotlin-generated JavaScript module?

**URL:** <https://discuss.kotlinlang.org/t/what-is-the-name-of-my-kotlin-generated-javascript-module/17235>\
**Category:** JavaScript\
**Created:** [April 20, 2020, 9:01am UTC](https://discuss.kotlinlang.org/t/what-is-the-name-of-my-kotlin-generated-javascript-module/17235 "2020-04-20T09:01:38Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![cantanima](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/cantanima/32/7439_2.png) [@cantanima](https://discuss.kotlinlang.org/u/cantanima)\
**Post date:** [December 16, 2020, 3:04am UTC](https://discuss.kotlinlang.org/t/what-is-the-name-of-my-kotlin-generated-javascript-module/17235/9 "2020-12-16T03:04:36Z")

</div>

I have encountered and a related problem, which may well have been the same thing. When I tried to produce a `BrowserProductionRun`, the resulting JavaScript files lacked any references to anything but the `main()` function.

I am writing a JavaScript library that I want to call from an HTML file, so I have a number of functions that aren’t called within the module itself, but will be called from JavaScript. Unfortunately, Kotlin’s Dead Code Elimination was eliminating those functions. As per [this page](https://kotlinlang.org/docs/reference/javascript-dce.html), simply adding

```
dceTask {
   keep("myModule.myFunction")
}

```

to `build.gradle.kts` did the trick.

Is this the only way to prevent the compiler from eliminating functions it thinks are pointless?

---

_[View the full topic](https://discuss.kotlinlang.org/t/what-is-the-name-of-my-kotlin-generated-javascript-module/17235)._
