diff --git a/src/formats/formats.js b/src/formats/formats.js index 49aba1047138..be48fa28af82 100644 --- a/src/formats/formats.js +++ b/src/formats/formats.js @@ -47,6 +47,13 @@ export function resolveFormat(collectionOrEntity, entry) { return formatByExtension(fileExtension); } + // If creating a new file, and an `extension` is specified in the + // collection config, infer the format from that extension. + const extension = collectionOrEntity.get('extension'); + if (extension) { + return formatByExtension(extension); + } + // If no format is specified and it cannot be inferred, return the default. return formatByName(); }