Skip to content

Commit 108cf7c

Browse files
committed
docs: update transform maps to relfect new /utils api
1 parent df65dbc commit 108cf7c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/react-icons/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,21 @@ module.exports = {
227227
{
228228
'@fluentui/react-icons': {
229229
transform: (importName) => {
230+
// Handle utility imports (bundleIcon, className constants)
231+
const utilityExports = [
232+
'bundleIcon',
233+
'iconClassName',
234+
'iconFilledClassName',
235+
'iconRegularClassName',
236+
'iconColorClassName',
237+
'iconLightClassName'
238+
];
239+
240+
if (utilityExports.includes(importName)) {
241+
return '@fluentui/react-icons/utils';
242+
}
243+
244+
// Handle icon imports
230245
const withoutSuffix = importName.replace(
231246
/(\d*)?(Regular|Filled|Light|Color)$/,
232247
''
@@ -262,6 +277,12 @@ If you use SWC for transpilation, add [@swc/plugin-transform-imports](https://ww
262277
{
263278
"@fluentui/react-icons": {
264279
"transform": [
280+
// Transform utility imports to /utils
281+
[
282+
"^(bundleIcon|iconClassName|iconFilledClassName|iconRegularClassName|iconColorClassName|iconLightClassName)$",
283+
"@fluentui/react-icons/utils"
284+
],
285+
// Transform icon imports to /svg/{icon-name}
265286
[
266287
"(\\D*)(\\d*)?(Regular|Filled|Light|Color)",
267288
"@fluentui/react-icons/svg/{{ kebabCase memberMatches.[1] }}"

0 commit comments

Comments
 (0)