This might sound like a rookie question, but why d...
# javascript
a
This might sound like a rookie question, but why doesn't the kotlin js compiler spit individual js files from individual kotlin files? e.g.
Copy code
src/main/kotlin
  + com.package.name
    - main.kt
    - test.kt
    - people.kt
to be split into say
Copy code
build/intermediate/js
  + com.package.name
     - main.js
     - test.js
     - people.js
And then let webpack pickup from there? What are the caveats?
t
1. Single file - simple
npm
library emulation (by id) 2. Different libraries can use same packages 3. Simple shared sideeffect injection (in single file)
a
1. I think not. One npm library can have multiple files. In this case, it'll be multiple files in one npm module. id'ed by say the gradle module name 2. That ain't a problem at all with npm AFAIK, different modules can share same folder structures i.e.
Copy code
build/intermediate/js
  + module_A
    + com/package/name
      - main.js
      - test.js
      - people.js
  + module_B
    + com/package/name
      - main.js
      - test.js
      - people.js
3. I don't fully grasp what you mean there
t
One npm library can have multiple files
Yes, if this library located in
node_modules
🙂
I don’t fully grasp what you mean there
3. For example you want to add polyfill at library start
a
I see. and how does the kotlin compiler solve this by now?
t
It creates single file 🙂
😂 2
a
hahahahahahaha