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

Allow to hook into classname generation after default interpolation logic pass #1422

Closed
SkReD opened this issue Feb 18, 2022 · 4 comments
Closed

Comments

@SkReD
Copy link
Contributor

SkReD commented Feb 18, 2022

Feature Proposal

Two proposal variants:

Feature Use Case

Replace className part which is duplicated across components with some short placeholder:
[path][name]__[local] -> src/blocks/button_link and replace with cmp-button_link

With current options it is not possible without copy pasting code from defaultGetLocalIdent.
localIdentRegExp is not flexible enought for this case because it not allow to pass replacement string.

Please paste the results of npx webpack-cli info here, and mention other relevant information

System:
OS: Windows 10 10.0.19043
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 9.51 GB / 23.86 GB
Binaries:
Node: 14.18.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.15 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 98.0.4758.102
Edge: Spartan (44.19041.1266.0), Chromium (98.0.1108.55)
Internet Explorer: 11.0.19041.1202
Monorepos:
Yarn Workspaces: 1.22.17
Packages:
karma-webpack: ^5.0.0 => 5.0.0
webpack: ^5.35.0 => 5.57.1
webpack-cli: ^4.6.0 => 4.7.2
webpack-merge: ^5.7.3 => 5.7.3

@alexander-akait
Copy link
Member

Why don't use custom function? It is very exotic

@SkReD
Copy link
Contributor Author

SkReD commented Feb 18, 2022

I want reuse default interpolation logic. Dont want to reimplement all escaping things and other stuff

@alexander-akait
Copy link
Member

alexander-akait commented Feb 18, 2022

Okay, let's do:

It will be better, because developer can does more things

@SkReD SkReD mentioned this issue Feb 21, 2022
6 tasks
@alexander-akait
Copy link
Member

Fixed

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

No branches or pull requests

2 participants