gajus / gajus/babel-plugin-react-css-modules

generateScopedName as a function

Open
#261 1 comment 3 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2k
Forks
159
PR merge metrics
No merged PRs in 30d

Description

I’m trying to use generateScopedName as a function which should be possible, but it resolves as `undefined`. F.ex;

``generateScopedName: (localName, resourcePath) => { return 'foo' }``

And then if I do `console.log(typeof options.generateScopedName)` in `requireCssModule` it becomes undefined. Strings works fine as the tests shows, but not functions.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the requireCssModule entry point mentioned in the report and trace how generateScopedName is read and passed through option handling. Review the existing tests for string generateScopedName behavior, then add coverage for the function form and confirm the function is preserved and used when the test suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, react
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.