Gunslingor
03/20/2020, 5:23 PMjs("frontend") {
browser {
tasks {
register<Exec>("webpack") {
dependsOn("yarn", "npmInstall")
//outputs.dir("$buildDir\\yyy\\")
commandLine("$buildDir\\js\\node_modules\\.bin\\webpack", "$buildDir\\js\\packages_imported\\kotlin\\1.3.70\\kotlin.js", "$buildDir\\js\\packages_imported\\three.js\\71.0.0-r\\three.js")
//, "$buildDir\\js\\packages_imported\\kotlin\\1.3.70\\kotlin.js", "$buildDir\\js\\packages_imported\\three.js\\71.0.0-r\\three.js"
}
}
}
}
Robert Jaros
03/20/2020, 5:31 PMimplementation(npm("three.js"))
should work without all this configuration optionsGunslingor
03/20/2020, 5:35 PMdependsOn("yarn", "npmInstall")
I think it worked to download them. to be honest I'm not comfortable with node most out of all these technologies even the new multiplatform stuff. I actually can't seem to comprehend how I should/want-to use it... ktor seems fine but I don't understand how I would use it with node.js if I'm using Kotlin JS... nodes purpose is to write server side in javascript, Kotlin JS's purpose is to avoid JS alltogether IMHO and ktor has its own services and framework. Bottom line I'm trying to setup the architecture of a full stack Kotlin (mostly/only) project using ktor and node SEEMS to be a requirement? I've been struggling with all this stuff.. could use a code review... and a tutor =)Robert Jaros
03/20/2020, 5:38 PMGunslingor
03/20/2020, 5:40 PMRobert Jaros
03/20/2020, 5:52 PMnpm()
dependency and use what is already implemented in kotlin/js pluginGunslingor
03/20/2020, 5:55 PMjs("frontend") {
browser {
nodejs {
webpackTask {
println("WEBPACKAGINGss")
configure<> { }
}
}/
}
}
I'm getting close with this I suspect... I think you need a webpack.config.js file to make this work traditionally, but that gets generated by gradle when it creates node so there has to be a way to configure it in gradle like this right?Robert Jaros
03/20/2020, 8:46 PM*.js
files to webpack.config.d
directory - their content will be added to the generated webpack.config.js
fileGunslingor
03/20/2020, 8:47 PMRobert Jaros
03/20/2020, 8:51 PMGunslingor
03/20/2020, 8:52 PMsetProperty("mode", "development")
and it propagates to the gradle created js/packages/project/webpack.config.js file, but I can't fiugure out how to make it modify the resolve.modules object which I suspect is what is needed to make this work... it seems to default to ["node_modules"] which does have everything... hmmm, maybe I just need to add an entry object somehowjs("frontend") {
browser {
nodejs {
webpackTask {
println("WEBPACKAGINGss")
setProperty("mode", "development")
setProperty("resolve") {
setProperty("modules", {"TEST"})
}
configure<Entry> { }
}
}
}
}
the experiuments// resolve modules
config.resolve.modules.unshift("C:\\Users\\gunsl\\IdeaProjects\\FL\\build\\js\\packages\\FL-frontend\\kotlin-dce")
config.resolve.modules.unshift("C:\\Users\\gunsl\\IdeaProjects\\FL\\build\\js\\packages_imported")
Is this right?