diff --git a/lib/standalone.js b/lib/standalone.js index 34190d312b..c55c795812 100644 --- a/lib/standalone.js +++ b/lib/standalone.js @@ -184,6 +184,18 @@ module.exports = function (options) { fileCache.destroy(); } + // Escape square brackets + fileList = fileList.map((p) => { + let path = p; + + if (path.match(/[[\]]/g)) { + path = path.split('[').join('\\['); + path = path.split(']').join('\\]'); + } + + return path; + }); + return globby(fileList, globbyOptions) .then((filePaths) => { // The ignorer filter needs to check paths relative to cwd