我有这个目录结构
├── 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'
任何人都知道如何使它工作?