Closed
Description
@module external css: {..} = "./PriceSwitcher.module.scss"
Js.log(css["priceMode_left"])
Js.log(css["priceMode__left"])
Js.log(css["priceMode__foo___left"])
Compiled to the following js:
var css = require("./PriceSwitcher.module.scss");
console.log(css.priceMode_left);
console.log(css.priceMode);
console.log(css.priceMode__foo_);
The second and the third console logs have incorrect field names. The playground: https://rescript-lang.org/try?version=v10.1.2&code=AIWw9gJgrgNgpgAjgDwC5wE4DsCGMEDGAzkQFwIDeAdFQL4IC8CARFQPQAKGAlgXAMoB3bqgIALTFXDR4VIsSLMAUEoBSRKjDABzABQKA2swAOPPgFlIcAPrwAZqmYBdAJRqNWvYZNm4liDa2cA7ObuqaOvokRqa8flbW1nZgYIlBIa5KQA
I've tried different versions, and it works incorrectly for all of them.
This is a common case when using the BEM methodology together with css modules.
Metadata
Metadata
Assignees
Labels
No labels