When running the project in dev mode, kotlin files...
# javascript
r
When running the project in dev mode, kotlin files from `src/main/kotlin' are compiled into
build/js/packages/[name]/kotlin/[name].js
but resources from
src/main/resources
are put into
build/processedResources/Js/main/
. When I try to
require
something from my code, webpack is unable to find these resources. Can it be configured somehow?
b
Odd, never had this issue myself. Are you using dce plugin as well?
r
No difference. It's the same.
b
Ah, i remember now. You need to include processed resources to webpack resolver dirs via webpack.d
It can be relative url so shouldn't be an issue with project's portability
r
how can i do this?
b
Just append an array in generated webpack.config with the dir path
Have a look at generated webpack.config to see how js transpiled sources are included
Hopefully this will become default for v1.3.70
r
thx, it's working
b
Glad to help
r
did you managed to get hot reload working?
I've got an error after source code change
shouldn't it work out of the box with new plugin? 🙂
b
Umm, kinda. But it's so buggy and unreliable that i just restart the server via gradle continuous task
😞 1
The most reloads I've managed to get without it crashing was 3 or 4
r
ok thx, I'll try to fight with this problem a bit as well ... 🙂
b
Wouldn't recommend it, best just wait for next release
r
Enabling polling with:
Copy code
config.devServer.watchOptions = {
            aggregateTimeout: 1000,
            poll: 100
    };
makes hot reload work quite stable (even for non minified, 14MB kvision app)
b
Ah, yes. This is something that has made it better for me when i tried it as well, but in the end it'd still crash every now and then
But at least it's reasonably stable with this
r
Any success in working around https://youtrack.jetbrains.com/issue/KT-34287 ? 🙂
b
Honestly, haven't faced this issue yet. But then again, it's been over a month since I've last worked with js side of kotlin
r
@Gurupad Mamadapur [FH]: In
webpack.config.d/webpack.js
I have:
Copy code
config.resolve.modules.push("../../processedResources/Js/main");
👍 1