Hey everyone, I would like to import a local javas...
# javascript
j
Hey everyone, I would like to import a local javascript file (that is not directly a npm dependency) in a kotlin js project. Is that possible? My google fu points me to [that Stack Overflow answer](https://stackoverflow.com/questions/67661122/is-it-possible-to-import-a-javascript-file-in-a-kotlin-js-project) talking about "hacking" it with local TS sources. Is that still the recommend way?
t
Yes, it’s possible
Is it for browser target?
j
yes
b
Put it in resources folder and use it as any other js module (path assuming resources folder as pwd)
t
webpack patch is required
webpack plugin will do it automatically
b
To do it manually, add an action to kotlinJsCompile to copy resources to task's output directory
j
hum, alright. Would you have an existing example by any chance?
b
I don't
j
ok, no worries. thanks both of you!
t
Resources from dependencies (subprojects) also will be available
😮 1