diff --git a/packages/plugin-core/manifest.json b/packages/plugin-core/manifest.json index 66a12c36f2..d55ad43e70 100644 --- a/packages/plugin-core/manifest.json +++ b/packages/plugin-core/manifest.json @@ -103,6 +103,12 @@ "default": false, "title": "Case sensitive", "description": "Whether matching should be case-sensitive" + }, + "usePath": { + "type": "boolean", + "default": false, + "title": "Use path", + "description": "Match the full path on the server instead of the original filename" } }, "required": ["pattern"] diff --git a/packages/plugin-core/src/index.ts b/packages/plugin-core/src/index.ts index 5dc358a2f0..d412ad7708 100644 --- a/packages/plugin-core/src/index.ts +++ b/packages/plugin-core/src/index.ts @@ -54,11 +54,11 @@ const methods = wrapper({ }, assetFileFilter: ({ data, config }) => { - const { pattern, matchType = 'contains', caseSensitive = false } = config; + const { pattern, matchType = 'contains', caseSensitive = false, usePath = false } = config; const { asset } = data; - const fileName = asset.originalFileName || ''; + const fileName = usePath ? asset.originalPath : asset.originalFileName; const searchName = caseSensitive ? fileName : fileName.toLowerCase(); const searchPattern = caseSensitive ? pattern : pattern.toLowerCase();