Skip to content

Conversation

mochiya98
Copy link
Contributor

@mochiya98 mochiya98 commented Aug 11, 2025

Summary

Support [folder] template string in localIdentName option

close #11184

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@Copilot Copilot AI review requested due to automatic review settings August 11, 2025 11:43
Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 74962e0
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/689b289e1d310c0008913979
😎 Deploy Preview https://deploy-preview-11356--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link

CLAassistant commented Aug 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Aug 11, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for [folder] template strings in the localIdentName option for CSS modules. This allows users to include the parent directory name in their CSS class name generation.

  • Added [folder] template string support to localIdentName option
  • Extracted folder name from the resource file path using Path::new().parent().file_name()
  • Integrated folder replacement logic into the existing template string system

@mochiya98 mochiya98 changed the title feat: support [folder] template strings in localIdentName option feat: support [folder] template strings in localIdentName option Aug 11, 2025
@mochiya98 mochiya98 changed the title feat: support [folder] template strings in localIdentName option feat: support [folder] template string in localIdentName option Aug 11, 2025
@CPunisher
Copy link
Contributor

Could you please add some tests?

@mochiya98
Copy link
Contributor Author

Sorry about that - since this was my first contribution, I wasn’t sure where the related tests were located, so I hadn’t added.
I’ve identified the appropriate spot and added them. Could you check if this looks okay? ( _ _)m

  • If the file is in a subdirectory, it uses the name of the nearest directory
  • If the file is directly under the root, it becomes an empty string

Copy link

codspeed-hq bot commented Aug 12, 2025

CodSpeed Performance Report

Merging #11356 will not alter performance

Comparing mochiya98:folder-local-ident-name (74962e0) with main (19b2442)

🎉 Hooray! codspeed-node just leveled up to 4.0.1!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched benchmarks

@CPunisher
Copy link
Contributor

Thanks!

@CPunisher CPunisher merged commit 28859a4 into web-infra-dev:main Aug 13, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: support [folder] template strings in localIdentName option
3 participants