Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 5879a8b

Browse files
committed
fix(copy): support overriding config entries with empty objects
1 parent a735e96 commit 5879a8b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/copy.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ function processRemoveFile(changedFile: ChangedFile) {
145145
// delete any destination files that match the source file
146146
const list = copyFilePathCache.get(changedFile.filePath) || [];
147147
copyFilePathCache.delete(changedFile.filePath);
148-
const promises: Promise<void>[] = [];
148+
const promises: Promise<void[]>[] = [];
149149
const deletedFilePaths: string[] = [];
150150
list.forEach(copiedFile => {
151151
const promise = unlinkAsync(copiedFile.absoluteDestPath);
@@ -251,8 +251,10 @@ export function copyConfigToWatchConfig(context: BuildContext): Watcher {
251251
const copyConfig: CopyConfig = fillConfigDefaults(configFile, taskInfo.defaultConfigFile);
252252
let results: GlobObject[] = [];
253253
for (const key of Object.keys(copyConfig)) {
254-
const list = generateGlobTasks(copyConfig[key].src, {});
255-
results = results.concat(list);
254+
if (copyConfig[key] && copyConfig[key].src) {
255+
const list = generateGlobTasks(copyConfig[key].src, {});
256+
results = results.concat(list);
257+
}
256258
}
257259

258260
const paths: string[] = [];

0 commit comments

Comments
 (0)