https://kotlinlang.org logo
#javascript
Title
# javascript
h

hikamaeng

03/17/2024, 11:27 AM
root/build.gradle.kts
Copy code
rootProject.plugins.withType<NodeJsRootPlugin> {
    rootProject.the<NodeJsRootExtension>().npmInstallTaskProvider.configure{
        inputs.files("package.json", "yarn.lock")
        outputs.dir("node_modules")
    }
}
rootProject.plugins.withType<YarnPlugin>{
    rootProject.the<YarnRootExtension>().yarnLockMismatchReport = YarnLockMismatchReport.NONE
    rootProject.the<YarnRootExtension>().reportNewYarnLock = false
    rootProject.the<YarnRootExtension>().yarnLockAutoReplace = false
}
After this setting, the build time for KotlinJS has dramatically decreased. Especially, the configuration of npmInstallTaskProvider was effective.
c

Chrimaeon

03/17/2024, 11:34 AM
Thanks for letting us know! 😅
I would just make the yarn root extension configuration more inline by accessing it once and configuring it in a configuration call.
a

Artem Kobzar

03/18/2024, 8:42 AM
@Ilya Goncharov [JB] ^^ Seems like it could also be helpful both for Kotlin/JS and Kotlin/Wasm
3 Views