From 27810d1e7e568df4f746cba23e738dd862574456 Mon Sep 17 00:00:00 2001 From: heymdall Date: Wed, 3 Jul 2019 16:27:53 +0300 Subject: [PATCH] fix(component-package): add ts index file support --- gulp/component-package.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gulp/component-package.js b/gulp/component-package.js index 3b95313..efd628b 100644 --- a/gulp/component-package.js +++ b/gulp/component-package.js @@ -12,7 +12,8 @@ const Vinyl = require('vinyl'); function getComponentPackage(file) { const dirname = path.dirname(file.path); const componentName = path.parse(file.path).name; - const isIndexFileExist = fs.existsSync(path.join(dirname, 'index.js')); + const isIndexFileExist = fs.existsSync(path.join(dirname, 'index.js')) + || fs.existsSync(path.join(dirname, 'index.ts')); return JSON.stringify({ main: isIndexFileExist ? 'index.js' : `${componentName}.js`, types: `${componentName}.d.ts`