Skip to content

[WIP/dont merge] add include option #143

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
wants to merge 2 commits into from
Closed

[WIP/dont merge] add include option #143

wants to merge 2 commits into from

Conversation

tyler-dot-earth
Copy link

What:

Adds include option so the plugin only hits. Works like exclude, but the opposite.

Why:

Been structuring my CSS Modules files like foo.module.css lately and wanted this option. Exclude didn't work for me (similar to this comment).

Related issues:

@tyler-dot-earth
Copy link
Author

tyler-dot-earth commented Nov 29, 2017

Note: still trying to test this in my own project (ReferenceError: Unknown plugin "react-css-modules" specified when trying to use my own branch via "babel-plugin-react-css-modules": "github:tsnieman/babel-plugin-react-css-modules.git#include-options", in package.json), but the tests seem to work fine when I npm run test. Tested locally but still encountering a "can't use multiple anonymous" error.

@gajus (or other maintainers) if you have any suggestions about why this is a bad idea/implementation/etc, lemme know and I'll fix it as best I can!

@tyler-dot-earth
Copy link
Author

Turns out there's already a similar/duplicate PR #106.

@tyler-dot-earth tyler-dot-earth changed the title add include option [WIP/dont merge] add include option Nov 29, 2017
@tyler-dot-earth
Copy link
Author

still encountering a "can't use multiple anonymous" error.

Wasn't caught by tests because tests apparently work differently than the plugin in actual use. Noticed that src/getClassName.js's .length behaves differently in actual use versus npm run test. Need to fix some additional logic apparently.

@tyler-dot-earth
Copy link
Author

lmfao i made all kinds of typos in this. closing. will reopen when it's sensible and i'm not distracted doing 15 things.

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

Successfully merging this pull request may close these issues.

1 participant