Kotlin / dukat

Converter of <any kind of declarations> to Kotlin external declarations
548 stars 44 forks source link

Use dukat with @tensorflow/tfjs npm package has a lot of errors #427

Open iHad169 opened 3 years ago

iHad169 commented 3 years ago
plugins {
    id("org.jetbrains.kotlin.js") version "1.4.21"
}

group = "package com.myapp"
version = "1.0.0"

repositories {
    maven("https://kotlin.bintray.com/kotlin-js-wrappers/")
    mavenCentral()
    jcenter()
}

dependencies {
    implementation(kotlin("stdlib-js"))
    ...
    //TensorFlow
    implementation(npm("@tensorflow/tfjs", "~2.8.1", generateExternals = true))
    implementation(npm("@tensorflow/tfjs-vis", "1.4.3", generateExternals = true))
    ...
}

kotlin {
    js {
        browser {
            webpackTask {
                cssSupport.enabled = true
            }

            runTask {
                cssSupport.enabled = true
            }

            testTask {
                useKarma {
                    useChromeHeadless()
                    webpackConfig.cssSupport.enabled = true
                }
            }
        }
        binaries.executable()

        useCommonJs()
    }
}

2020-12-29 16-27-16 的螢幕擷圖