diff --git a/src/utils.js b/src/utils.js index a9c84a0..177144f 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,10 +1,16 @@ -import { join } from 'path'; +// import { join } from 'path'; import arrify from 'arrify'; +const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g; + export function parseFiles(files, context) { - return arrify(files).map((file) => - replaceBackslashes(join(context, '/', file)) + return arrify(files).map( + (file) => + `${replaceBackslashes(context).replace( + UNESCAPED_GLOB_SYMBOLS_RE, + '\\$2' + )}/${replaceBackslashes(file)}` ); }