Skip to content
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

Feature/generate scoped name from config file #7

Conversation

tomrule007
Copy link
Contributor

Add support for customizing generated class names with generateScopeName property in jesttransformcss.config.js as discussion in Issue #6

// example jesttransformcss.config.js
module.exports = {
  modules: (filename) => filename.endsWith('.module.css'),
  generateScopedName: "[folder]_[name]_[local]"
};

Also updated readme with instructions to use the new property and a link to all available placeholder tokens. Though I noted not all of them seem to be working, could be a new/older version issue.

@tomrule007
Copy link
Contributor Author

It appears to be working on my end, though i will say testing a local copy of a package was a pain in the ass. I should have just spend time adding some tests to the package instead of relying on linking the local copy to my project.

I ended up using yalc to facilitate the local package linking but it still required me to re-run npm install after every change.

Copy link
Owner

@dferber90 dferber90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is neat!

@dferber90
Copy link
Owner

I ended up using yalc to facilitate the local package linking but it still required me to re-run npm install after every change.

I think I started editing straight inside node_modules back then and only moved the changes to the real repo once I got it working as expected. But I can't quite remember as it's been a long time. Maybe it's a useful tip for the future.

Thanks for the feature! I'll release it right away.

@dferber90 dferber90 merged commit 528d5da into dferber90:master Sep 24, 2020
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.

2 participants