Feat/add regexp support for filetype #240
Merged
Conversation
added 5 commits
Mar 3, 2019
…on style filetype
and others
added 2 commits
Apr 12, 2020
This was referenced Sep 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Add supports for using RegExp patterns as key names in
filetypeUsage
Now, we can use a RegExp pattern in
filetypesto specify a certain file.Consider the following config.
According to the config above,
babel-plugin-react-css-moduleswill match and processanother.mod.sass, but liveanother.sassalone.Why is this useful?
Sometimes, I want to import some
.sassfile as global styles (such as styles for the common UI). However, if I just add the key.sasstofiletypes, then all imported.sassfiles 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
.sassfiles.Compatibility
The all test cases is covered. (
yarn teston my computer.)It is worth discussing further if there are any better implements or API designs.