Skip to content

Commit 3b528ef

Browse files
authored
fix(react-icons): normalize chunk PURE annotation generation (#863)
1 parent 3d2f6be commit 3b528ef

3 files changed

Lines changed: 31 additions & 31 deletions

File tree

packages/react-icons/build-verify.test.js

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-icons/convert-font.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ function generateReactIconEntries(iconEntries, resizable) {
162162
let destFilename = getReactIconNameFromGlyphName(iconName, resizable);
163163
var flipInRtl = metadata[destFilename] === 'mirror';
164164
let iconStyle = /filled$/i.test(iconName) ? 0 /* Filled */ : /regular$/i.test(iconName) ? 1 /* Regular */ : 3 /* Light */
165-
var jsCode = `export const ${destFilename} = /*#__PURE__*/createFluentFontIcon(${JSON.stringify(destFilename)
165+
var jsCode = `export const ${destFilename} = (/*#__PURE__*/createFluentFontIcon(${JSON.stringify(destFilename)
166166
}, ${JSON.stringify(String.fromCodePoint(codepoint))
167167
}, ${resizable ? 2 /* Resizable */ : iconStyle
168168
}, ${resizable ? undefined : ` ${/(?<=_)\d+(?=_filled|_regular|_light)/.exec(iconName)?.[0]}`
169-
}${flipInRtl ? `, { flipInRtl: true }` : ''});`;
169+
}${flipInRtl ? `, { flipInRtl: true }` : ''}));`;
170170

171171
iconExports.push(jsCode);
172172
}

packages/react-icons/convert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ function processFiles(src, dest) {
8686

8787
/**
8888
* Process a folder of svg files and convert them to React components, following naming patterns for the FluentUI System Icons
89-
* @param {string} srcPath
90-
* @param {boolean} resizable
89+
* @param {string} srcPath
90+
* @param {boolean} resizable
9191
* @returns { string [] } - chunked icon files to insert
9292
*/
9393
function processFolder(srcPath, destPath, resizable) {
@@ -165,6 +165,6 @@ function fileTemplate(
165165

166166
componentName.name = componentName.name.substring(3)
167167
componentName.name = componentName.name.replace('IcFluent', '')
168-
168+
169169
return jsx;
170170
}

0 commit comments

Comments
 (0)