const chokidar = require('chokidar')
const path = require('path')
let pathStr = path.join(__dirname, 'utils')
console.log(pathStr)
chokidar.watch(pathStr, {
persistent: true,
ignored: /.js/ // 用正则匹配来筛选
}).on('all', (event, path) => {
console.log(event, path)
})
网友评论