diff --git a/packages/mjml-cli/src/commands/watchFiles.js b/packages/mjml-cli/src/commands/watchFiles.js index 24884a70d..bf2802a7a 100644 --- a/packages/mjml-cli/src/commands/watchFiles.js +++ b/packages/mjml-cli/src/commands/watchFiles.js @@ -1,6 +1,7 @@ /* eslint-disable no-console */ import chokidar from 'chokidar' -import { glob } from 'glob' +import { sync } from 'glob' +import { match } from 'minimatch' import path from 'path' import mjml2html from 'mjml-core' import { flow, pickBy, flatMap, uniq, difference, remove } from 'lodash/fp' @@ -98,8 +99,7 @@ export default (input, options) => { console.log(`Now watching file: ${filePath}`) const matchInputOption = input.reduce( - (found, file) => - found || glob(path.resolve(file)).minimatch.match(filePath), + (found, file) => found || match(sync(path.resolve(file)), filePath), false, )