Nicolas Acart
03/25/2021, 9:29 PM*import* 'katex/dist/katex.min.css';
in kotlin/js ?
I already have :
@file:JsModule("react-katex")
@file:JsNonModule
package fr.jeanjacquelin.adminmc.front.component.wrapper.katex
import react.Component
import react.RProps
import react.RState
import react.ReactElement
external interface InlineMathProps : RProps {
var math: String?
}
@JsName("InlineMath")
external class InlineMathComponent : Component<InlineMathProps, RState> {
override fun render(): ReactElement?
}
(I also did the dsl function to call it)
It works but the css is not loadedturansky
03/25/2021, 10:20 PM@JsName("require")
private external fun requireCss(path: String): dynamic
private val katexCss = requireCss("react-katex/dist/katex.min.css")
with enabled css support
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
Gradle script exampleNicolas Acart
03/25/2021, 10:21 PMNicolas Acart
03/25/2021, 10:34 PMModule 'react-katex/dist/katex.min.css' not found
Nicolas Acart
03/25/2021, 10:36 PMNicolas Acart
03/25/2021, 11:00 PMrequireCss("katex/dist/katex.min.css")
instead of
requireCss("react-katex/dist/katex.min.css")
so mb for this one but I still have an error with the loader:
Module parse failed: Unexpected character ' ' (1:4)
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>
(Source code omitted for this binary file)
This error is repeated a lot and I don't understand itNicolas Acart
03/25/2021, 11:10 PM