madyankin / madyankin/postcss-modules

Options.getJSON is not executed in a .css file that contains the same styles as another .css file

Open
#156 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.6k
Forks
88
PR merge metrics
No merged PRs in 30d

Description

My project has the following structure:

  • components/
    index.css
    • header/
      index.css
      • B2B/
        index.css
        • shared/
          • menu/
            index.css
            • subcomponents/
              subMenuList.module.css
              menuList.module.css
      • B2B/
        index.css
        • shared/
          • menu/
            index.css
            • subcomponents/
              subMenuList.module.css
              menuList.module.css

For specific project reasons, the subMenu List.module.css file (B2B and B2C) contains styles that are identical to each other. The menuList.module.css file contains a slight variation: color: var(--primary-color) and color: var(--secondary-color).

In the build, getJSON passes through the components/header/B2C/shared/menu/subcomponents/subMenuList.module.css file, but not through components/header/B2B/shared/menu/subcomponents/subMenuList.module.css. This same behavior does not happen with components/header/[B2C|B2B]/shared/menu/subcomponents/menuList.module.css, the behavior I expect from all files. Is this a desired behavior for the build process or is it a bug?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the duplicated B2B and B2C CSS paths, especially subMenuList.module.css and menuList.module.css. Trace when Options.getJSON is invoked for each file and compare the build behavior. Done means the intended handling of identical CSS modules is established and covered by a regression check or clearly documented as expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.