According to the config above, babel-plugin-react-css-modules will match and process another.mod.sass, but live another.sass alone.
Why is this useful?
Sometimes, I want to import some .sass file as global styles (such as styles for the common UI). However, if I just add the key .sass to filetypes, then all imported .sass files would be processed, including those containing global styles. (By the way, I dislike :global.)
The support for RegExp patterns would also be useful when assigning the different plugin lists (or other config items) to the different .sass files.
Compatibility
The all test cases is covered. (yarn test on my computer.)
It is worth discussing further if there are any better implements or API designs.
Add supports for using RegExp patterns as key names in
filetype
Usage
Now, we can use a RegExp pattern in
filetypes
to specify a certain file.Consider the following config.
According to the config above,
babel-plugin-react-css-modules
will match and processanother.mod.sass
, but liveanother.sass
alone.Why is this useful?
Sometimes, I want to import some
.sass
file as global styles (such as styles for the common UI). However, if I just add the key.sass
tofiletypes
, then all imported.sass
files would be processed, including those containing global styles. (By the way, I dislike:global
.)The support for RegExp patterns would also be useful when assigning the different plugin lists (or other config items) to the different
.sass
files.Compatibility
The all test cases is covered. (
yarn test
on my computer.)It is worth discussing further if there are any better implements or API designs.