diff --git a/devtools/buildIndexFiles.js b/devtools/buildIndexFiles.js index a6b7d6fa9..9e86c22d7 100644 --- a/devtools/buildIndexFiles.js +++ b/devtools/buildIndexFiles.js @@ -28,8 +28,13 @@ componentDirs.map((directory) => { directory.fileNames.map((fileName) => { // Grab the file's exports. let components = require(path.join(directory.path, fileName)); + Object.keys(components).map((component) => { - fileContents += `export { ${component} } from './${fileName}';\n`; + if (component === 'default') { + fileContents += `export { default as ${components.default.name} } from './${fileName}';\n`; + } else { + fileContents += `export { ${component} } from './${fileName}';\n`; + } }); }); // write the index file into the directory.