All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jsMain.kotlinext.js.CommonJS.kt Maven / Gradle / Ivy

There is a newer version: 1.0.1-pre.808
Show newest version
package kotlinext.js

import kotlin.js.RegExp

external interface Context : JsFunction1 {
    fun resolve(module: String): String
    fun keys(): Array
    val id: Int
}

fun requireAll(context: Context) = context.keys().forEach(context::invoke)

external object require {
    fun resolve(module: String): String

    // Note: require.context is a webpack-specific function
    fun context(directory: String, useSubdirectories: Boolean, regExp: RegExp): Context
}

external fun require(module: String): dynamic




© 2015 - 2024 Weber Informatics LLC | Privacy Policy