Is it not possible to put stuff in different files...
# getting-started
r
Is it not possible to put stuff in different files/subfolders and import them back into main, when doing KotlinJS? I have
src/main.kt
and
src/helpers/foo.kt
At the top of
foo.kt
I say
package helpers
, then in
main.kt
I do
import helpers
. I get
Copy code
Packages cannot be importedkotlin(PACKAGE_CANNOT_BE_IMPORTED)
d
import helpers.foo
you are trying to import the package itself, not the class inside the package
y
If you want to import everything inside of it, you can do
import helpers.*
. If you just want to be able to write
helpers.foo(x)
, then no imports are needed, it just works!