From 62186717e4e229f0dd32fcf16c9b75055de99bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bene=C5=A1?= Date: Tue, 2 Apr 2019 13:44:53 +0200 Subject: [PATCH] Type should be exported only in the index file (#11) close #10 --- src/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 2908dd5..ebbf6a0 100644 --- a/src/utils.js +++ b/src/utils.js @@ -18,7 +18,9 @@ const FILE_BANNER = `/** */ import * as React from 'react'; +`; +const INDEX_EXTRA_CONTENT = ` export type IconComponent = React.SFC<{ className?: string }>; `; @@ -202,7 +204,7 @@ async function generateComponent(iconName, options) { function createIndexFile(icons, options) { const { exportPath, suffix } = options; - let content = FILE_BANNER; + let content = FILE_BANNER + INDEX_EXTRA_CONTENT; for (icon of icons) { name = getComponentNameFromFileName(icon);