- Add functionality to ignore files based on provided
regular expressions
- Support writeIndex and writeIndexCli
- in index.js config must be specified as below
// @create-index {"ignore":["/foo.js"]}
15 lines
244 B
JavaScript
15 lines
244 B
JavaScript
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
export default (directoryPath) => {
|
|
const indexPath = path.resolve(directoryPath, 'index.js');
|
|
|
|
try {
|
|
fs.statSync(indexPath);
|
|
|
|
return true;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
};
|