Adam Szadkowski
02/23/2020, 9:29 AM@JsModule("typeface-roboto")
@JsNonModule
external val roboto: dynamic
I am getting an error that webpack is unable to load css:
Module parse failed: Unexpected character '@' (2:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See <https://webpack.js.org/concepts#loaders>
But still - looking at DSL for
kotlin.target.browser { }
I was not able to find anything which would allow to add new loader.
Is there any solution to this?Robert Jaros
02/23/2020, 10:09 AMwebpack.config.d/css.js
file with:
config.module.rules.push({ test: /\.css$/, loader: "style-loader!css-loader" });
Robert Jaros
02/23/2020, 10:11 AMcss-loader
if it's not already thereAdam Szadkowski
02/23/2020, 11:17 AM@JsModule("bootstrap")
@JsNonModule
external val bootstrapModule: dynamic
An in Main.kt file:
fun main() {
console.log(bootstrapModule.default)
but it gives "undefined" as a return and log is empty. Any advice here?Robert Jaros
02/23/2020, 11:33 AMrequire("bootstrap/dist/css/bootstrap.min.css")
require("bootstrap/dist/js/bootstrap.bundle.min.js")
Robert Jaros
02/23/2020, 11:34 AMrequire
as external
function:
external fun require(name: String): dynamic
Sebastian Aigner
02/24/2020, 4:02 AMwebpack.config.d
files in the near future (just like I do), consider adding your vote to https://youtrack.jetbrains.com/issue/KT-32721 “support `useCssLoader()`“.Adam Szadkowski
02/24/2020, 7:22 AM