Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-icons/scripts/writeIcons.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ exports["default"] = exports.${jsName};
const writeESMExport = (fname, jsName, icon, rhUiIcon = null) => {
outputFileSync(
join(outDir, 'esm/icons', `${fname}.js`),
`import { createIcon } from '../createIcon';
`import { createIcon } from '../createIcon.js';

export const ${jsName}Config = {
name: '${jsName}',
Expand All @@ -53,7 +53,7 @@ export default ${jsName};

const writeDTSExport = (fname, jsName, icon, rhUiIcon = null) => {
const text = `import { ComponentClass } from 'react';
import { SVGIconProps } from '../createIcon';
import { SVGIconProps } from '../createIcon.js';
export declare const ${jsName}Config: {
name: '${jsName}',
icon: ${JSON.stringify(icon)},
Expand Down Expand Up @@ -126,7 +126,7 @@ function writeIcons(icons) {
});

const esmIndexString = index
.map(({ fname, jsName }) => `export { ${jsName}, ${jsName}Config } from './${fname}';`)
.map(({ fname, jsName }) => `export { ${jsName}, ${jsName}Config } from './${fname}.js';`)
.sort()
.join('\n');
outputFileSync(join(outDir, 'esm', 'icons/index.js'), esmIndexString);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-icons/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './icons/index';
export * from './icons/index.js';
Loading