From 38c409465597a0ea3f98a345367ddddb9b2a4f7a Mon Sep 17 00:00:00 2001 From: Andrei Miulescu Date: Sun, 11 Aug 2019 13:22:27 +1000 Subject: [PATCH] feat: add outputFile for typescript etc --- src/utilities/writeIndex.js | 2 +- src/utilities/writeIndexCli.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilities/writeIndex.js b/src/utilities/writeIndex.js index d12d96a..89a9ccf 100644 --- a/src/utilities/writeIndex.js +++ b/src/utilities/writeIndex.js @@ -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); }); diff --git a/src/utilities/writeIndexCli.js b/src/utilities/writeIndexCli.js index e7626ff..0b8d12d 100644 --- a/src/utilities/writeIndexCli.js +++ b/src/utilities/writeIndexCli.js @@ -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 }); });