hfhbd
04/27/2022, 1:14 PMapi(npm("bootstrap"))
. The js files are included, but the css files are not. How can I publish the css files too, so the user does not need to import it separatly?Big Chungus
04/27/2022, 1:32 PMBig Chungus
04/27/2022, 1:33 PMBig Chungus
04/27/2022, 1:33 PMhfhbd
04/27/2022, 1:35 PMBig Chungus
04/27/2022, 1:35 PMBig Chungus
04/27/2022, 1:36 PMBig Chungus
04/27/2022, 1:38 PMhfhbd
04/27/2022, 1:39 PM// bootstrap-compose
js(IR) {
browser {
binaries.library()
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
val jsMain by getting {
dependencies {
api(npm("bootstrap", "5.1.3"))
}
}
// showcase
js(IR) {
browser {
binaries.executable()
commonWebpackConfig {
cssSupport.enabled = true
}
}
}
sourceSets {
val jsMain by getting {
dependencies {
implementation(projects.bootstrapCompose)
}
}
}
index of showcase
<!DOCTYPE html>
<html lang="en" class="h-100">
<head>
<title>Bootstrap Compose Showcase</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body class="h-100">
<div id="root" class="d-flex flex-column h-100"></div>
</body>
<script src="showcase.js"></script>
</html>
Or do I need to import/load the css file in Kotlin code?Big Chungus
04/27/2022, 1:41 PMBig Chungus
04/27/2022, 1:41 PMhfhbd
04/27/2022, 1:56 PM@OptIn(ExperimentalStdlibApi::class)
@EagerInitialization
internal val loadCss: Unit = run {
require("bootstrap/dist/css/bootstrap.min.css")
}
internal external fun require(module: String): dynamic
Big Chungus
04/27/2022, 2:36 PMBig Chungus
04/27/2022, 5:24 PMhfhbd
04/27/2022, 5:30 PMModule build failed (from /Users/philipwedemann/GitHub/bootstrap-compose/build/js/node_modules/style-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
How did you solve this with your kmdc wrapper?Big Chungus
04/27/2022, 5:50 PMhfhbd
04/27/2022, 6:35 PMBig Chungus
04/27/2022, 6:47 PMhfhbd
04/27/2022, 6:49 PM