Skip to content

Commit e23728b

Browse files
authored
fix(icons): update internal import specifier (#12265)
* fix(icons): update internal import specifier * update index with file specifier
1 parent ceee225 commit e23728b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-icons/scripts/writeIcons.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ exports["default"] = exports.${jsName};
3636
const writeESMExport = (fname, jsName, icon, rhUiIcon = null) => {
3737
outputFileSync(
3838
join(outDir, 'esm/icons', `${fname}.js`),
39-
`import { createIcon } from '../createIcon';
39+
`import { createIcon } from '../createIcon.js';
4040
4141
export const ${jsName}Config = {
4242
name: '${jsName}',
@@ -53,7 +53,7 @@ export default ${jsName};
5353

5454
const writeDTSExport = (fname, jsName, icon, rhUiIcon = null) => {
5555
const text = `import { ComponentClass } from 'react';
56-
import { SVGIconProps } from '../createIcon';
56+
import { SVGIconProps } from '../createIcon.js';
5757
export declare const ${jsName}Config: {
5858
name: '${jsName}',
5959
icon: ${JSON.stringify(icon)},
@@ -126,7 +126,7 @@ function writeIcons(icons) {
126126
});
127127

128128
const esmIndexString = index
129-
.map(({ fname, jsName }) => `export { ${jsName}, ${jsName}Config } from './${fname}';`)
129+
.map(({ fname, jsName }) => `export { ${jsName}, ${jsName}Config } from './${fname}.js';`)
130130
.sort()
131131
.join('\n');
132132
outputFileSync(join(outDir, 'esm', 'icons/index.js'), esmIndexString);

packages/react-icons/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './icons/index';
1+
export * from './icons/index.js';

0 commit comments

Comments
 (0)