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`