parcel-bundler / parcel-bundler/lightningcss
CSS Modules hashes clash within the same file
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
I ran into an issue where styles worked in dev but broke in the production build because I set the pattern option to [hash] but it turned out that the hashes were the same for each .module.css file.
You can see this in the current test suite. Notice how the classes are only unique because of the trailing _[local] value. This would break if only the hashes were included: https://github.com/parcel-bundler/lightningcss/blob/27cb9c2a382fd8d9702de8def9dd18db54280c43/tests/cli_integration_tests.rs#L95-L129
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/cli_integration_tests.rs around lines 95-129, where the current CSS Modules behavior and pattern are exercised. Run that test and compare output using [hash] alone; done means classes from each .module.css file remain unique without requiring a trailing [local].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- build-system, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100