Skip to content

Commit

Permalink
fix(component-package): add ts index file support
Browse files Browse the repository at this point in the history
  • Loading branch information
Heymdall committed Jul 3, 2019
1 parent 6ac3711 commit 27810d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gulp/component-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 27810d1

Please sign in to comment.