[Modules] Mupliple dots in filenames

I have a file with multiple dots in the filename - like Color.css.res.

How do I open the module in another file, since open Color/open Color.css doesnt work?

As far as I know you can’t actually reference such a file from Rescript. Try to give it a name without a dot if it’s possible.

It is not possible - some library requires all style files to have .css prefix.

Then if you need this I would recommend to write the code in a file without dot and then include this module inside the .css.res file.

1 Like

Sounds reasonable.

But still, when I declare

// Color.css.res
module ColorCSS {
}

I can not access ColorCSS in Color.res file.

The suggestion was to do something like this:

// Color_css.res
let color = "red"

// Color.css.res
include Color_css

// Color.res
let theColor = Color_css.color
2 Likes

It sort of worked, but I need to import types and data from filename that contains .css anyway.
But as a workaround, I guess it works to some degree.

From the docs:

Please note that modules with an exotic filename will not be accessible from other ReScript modules.