Skip to content

filetypes extensions don't support ".module.less" #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wbern opened this issue Dec 13, 2017 · 2 comments
Closed

filetypes extensions don't support ".module.less" #148

wbern opened this issue Dec 13, 2017 · 2 comments

Comments

@wbern
Copy link

wbern commented Dec 13, 2017

As title states, it does not seem to be possible to care only about .module-files.

PR #144 seems intended to fix that (include option)

@wbern
Copy link
Author

wbern commented Dec 13, 2017

Actually, this can already be done using exclude.
Saw issue #91 which pointed me in the right direction.

My settings:

plugins: [
    (...),
    [
        "react-css-modules",
        {
            context: options.context,
            // include: "\.module\.(less|css)$", // PR pending
            exclude: "^(?!.*module).+\.(less|css)$",
            filetypes: {
                ".less": {
                    syntax: "postcss-less"
                }
            }
        }
    ]
]

@wbern wbern closed this as completed Dec 13, 2017
@tyler-dot-earth
Copy link

tyler-dot-earth commented Dec 17, 2017

For what it's worth, I didn't find ⬆️ this style of exclusion worked for me in my .babelrc.

(I authored #144).

EDIT: Seems like the \ character was breaking the string-to-regex interpretation. Making it like this fixed my issue: "exclude": "^(?!.*module).+\\.(css)$",. Suspicion is that it has something to do with me using .babelrc instead of webpack for this config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants