【发布时间】:2019-07-07 19:35:03
【问题描述】:
我有这个目录结构
├── components
│ ├── quarks
│ │ └── index.js
│ │ └── ...
│ ├── bosons
│ │ └── index.js
│ │ └── GridLayout.vue
│ │ └── ...
│ ├── atoms
│ │ └── ButtonStyle.vue
│ │ └── InputStyle.vue
│ │ └── index.js
│ │ └── ...
│ ├── .......
└─────
我想忽略每个文件夹中的index.js,但我没有得到它,我已经尝试了多种方式
const path = require('path')
const chokidar = require('chokidar')
const ROOT_PATH = path.resolve('components')
const watcher = chokidar.watch(ROOT_PATH, {
ignored: ROOT_PATH + '/*/index.js', //does not work
ignoreInitial: true
})
已经尝试过:
'./components/**/index.js',
'./components/*/index.js',
'components/*/index.js',
'components/**/index.js',
'ROOT_PATH + '/**/index.js'
有人知道如何让它工作吗?
【问题讨论】:
-
@Emma,这两个选项都不起作用,但感谢您的尝试
标签: node.js regex glob chokidar