MarcinM
MarcinM

Reputation: 468

Kotlin/JS package is empty

In the following project: https://github.com/MarcinMoskala/AnkiMarkdown

When I push a package to NPM, it seems empty. No binary code. I do export a single class: https://github.com/MarcinMoskala/AnkiMarkdown/blob/master/src/jsMain/kotlin/AnkiConnectorJs.kt

In the build/packages/js I have all the files I need, they are just not included in the final package.

Upvotes: 2

Views: 99

Answers (1)

Nestor Ledon
Nestor Ledon

Reputation: 1992

Publish is likely being ran in an empty directory. Create a custom Gradle task and run publish within build/js/packages/AnkiMarkdown/ and you should be good.

val outputDirectory = "../build/js/packages/AnkiMarkdown/"
val taskPublish = "publish"
tasks.register(taskPublish) {
    doLast {
        exec {
            workingDir = project.file(outputDirectory)
            commandLine("npm", "publish")
        }
    }
}

Upvotes: 0

Related Questions