feat: add outputFile for typescript etc

This commit is contained in:
Andrei Miulescu
2020-05-18 10:01:37 -07:00
committed by Gajus Kuizinas
parent 1f87f9a8b3
commit 38c4094655
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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);
});
+1 -1
View File
@@ -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
});
});