Hey, I have a Kotlin lib which exports a CSS file ...
# javascript
h
Hey, I have a Kotlin lib which exports a CSS file (bootstrap.css) by using
webpackTask { cssSupport.enabled = true }
in the library (bootstrap-compose) as well as in the consumer project. Executing a full build or just browserWebpack creates working js file, which is good. But I am not able to use
browserDevelopmentRun
anymore:
Copy code
Module parse failed: Unexpected character '@' (1: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>
> @charset "UTF-8";/*!
How can I use the loader in
browserRun
too?
b
Instead of webpackTask dsl use commonWebpackConfig
This will configure webpack for both tasks
Alternatively you can duplicate the config in runTask dsl
And then likely testTask dsl too
h
Seriously, that's all? 🤦‍♂️ Thanks!
b
Yep
h
Yeah, it works. Nice 😄
b
But tbh I prefer a more direct approach: https://github.com/mpetuska/kmdc#setup (scss bit) Lets you manage the versions and makes it easy to further extend the config (e.g. scss)