Trying to integrate stylus in my KotlinJS project....
# javascript
d
Trying to integrate stylus in my KotlinJS project. Gradle:
Copy code
implementation(npm("stylus", "0.54.8"))
but
resources/stylus/main.styl
file is not processed with
browserDevelopmentRun
or
browserDevelopmentWebpack
just copied into
build/distributions/stylus/main.styl
adding /webapack.config.d/stylus.config.js doesn’t help either. https://webpack.js.org/loaders/stylus-loader/ https://kotlinlang.org/docs/reference/js-project-setup.html#configuring-webpack-bundling Where is a proper documentation how to use webpack with KotlinJS?
b
you need to append stylus rules to webpack.config.d and add tour processedResources dir to webpack's modules in the same way
d
I ask me why is this not default project wizard?
b
Because stylus has nothing to do with kotlin js normally
d
Ok but I thought that Jetbrains uses webpack for bundling. Assets and so on… Or is it only for kotlin library?
b
They do, but again, stylus is not directly relevant to webpack nor kotlin/js
Also kotlin/mpp/js plugins do use webpack to further optimise compiler output and produce a single js executable