I have been struggling for many days. it’s just too many technologies to learn in a single shot. My code started working at some point of time but now it’s not working again.
I just can’t load CSS … no matter what I do. I tried everything in the documentation. I am trying to load CSS using webpack.
It’s important to understand that all Rescript does is change your code to Javascript. This means that Rescript doesn’t have a concept of “importing css”, it just changes it to JS imports
So that means when using one of the above 3 methods, we need to look at what the output is happening and try to match that up with the webpack docs.
This does the same thing, except imports the default value (export default )
const styles = require("./Tutorial.css").default
So all you’re looking for from rescript is which one converts it to a format that your bundler (webpack) will understand. It’s important to understand how modules work and the difference between commonjs and es6, below are some links that might give you an idea of what’s happening behind the scenes