Skip to content

Commit 865547e

Browse files
fix: CORUI-6264: Support default exports for components (#419)
1 parent 8ad553b commit 865547e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

devtools/buildIndexFiles.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ componentDirs.map((directory) => {
2828
directory.fileNames.map((fileName) => {
2929
// Grab the file's exports.
3030
let components = require(path.join(directory.path, fileName));
31+
3132
Object.keys(components).map((component) => {
32-
fileContents += `export { ${component} } from './${fileName}';\n`;
33+
if (component === 'default') {
34+
fileContents += `export { default as ${components.default.name} } from './${fileName}';\n`;
35+
} else {
36+
fileContents += `export { ${component} } from './${fileName}';\n`;
37+
}
3338
});
3439
});
3540
// write the index file into the directory.

0 commit comments

Comments
 (0)