Can css/sass/stylus files be directly imported into Elm files in some way? The webpack css-loader
module makes this possible in Javascript with an import './styles.css'
, but I can't find anything on how one might do it in Elm with or without Webpack.
I had the same question when I started looking into styles and I ended up making a POC of how that might look like by using Elm port and subscriptions to tell Webpack to fetch CSS modules.
Check it out: https://github.com/geekyme/elm-css-modules
I don't think this can be done directly, but you can create a bridging entry point for Webpack that will import everything, including CSS and Elm together, for bundling.
Check this out: http://www.elm-tutorial.org/050_starting/webpack.html#indexjs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With