Skip to content

Commit

Permalink
feat: add outputFile for typescript etc
Browse files Browse the repository at this point in the history
  • Loading branch information
andreimc authored and gajus committed May 18, 2020
1 parent 1f87f9a commit 38c4094
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utilities/writeIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default (directoryPaths, options = {}) => {
const optionsWithConfig = Object.assign({}, options, {config});
const siblings = readDirectory(directoryPath, optionsWithConfig);
const indexCode = createIndexCode(siblings, optionsWithConfig);
const indexFilePath = path.resolve(directoryPath, 'index.js');
const indexFilePath = path.resolve(directoryPath, optionsWithConfig.outputFile || 'index.js');

fs.writeFileSync(indexFilePath, indexCode);
});
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/writeIndexCli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default (directoryPaths, options = {}) => {
if (options.updateIndex || options.recursive) {
sortedDirectoryPaths = _.map(sortedDirectoryPaths, (dir) => {
return findIndexFiles(dir, {
fileName: options.updateIndex ? 'index.js' : '*',
fileName: options.updateIndex ? options.outputFile || 'index.js' : '*',
silent: options.updateIndex || options.ignoreUnsafe
});
});
Expand Down

0 comments on commit 38c4094

Please sign in to comment.