feat(config): add ignoreOptions for node-ignore (#6597)

This commit is contained in:
Xin Du (Clark) 2019-11-24 12:28:37 +00:00 committed by Pooya Parsa
parent 2f76e8e875
commit 9ada4e63a9
4 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import ignore from 'ignore'
export default class Ignore {
constructor (options) {
this.rootDir = options.rootDir
this.ignoreOptions = options.ignoreOptions
this.addIgnoresRules()
}
@ -17,7 +18,7 @@ export default class Ignore {
const ignoreFile = path.resolve(this.rootDir, Ignore.IGNORE_FILENAME)
if (fs.existsSync(ignoreFile) && fs.statSync(ignoreFile).isFile()) {
this.ignoreFile = ignoreFile
this.ignore = ignore()
this.ignore = ignore(this.ignoreOptions)
}
}
return this.ignoreFile

View File

@ -47,6 +47,7 @@ export default () => ({
alias: {},
// Ignores
ignoreOptions: undefined,
ignorePrefix: '-',
ignore: [
'**/*.test.*',

View File

@ -220,6 +220,7 @@ Object {
"**/*.spec.*",
"**/-*.*",
],
"ignoreOptions": undefined,
"ignorePrefix": "-",
"layoutTransition": Object {
"mode": "out-in",

View File

@ -196,6 +196,7 @@ Object {
"**/*.test.*",
"**/*.spec.*",
],
"ignoreOptions": undefined,
"ignorePrefix": "-",
"layoutTransition": Object {
"mode": "out-in",
@ -548,6 +549,7 @@ Object {
"**/*.test.*",
"**/*.spec.*",
],
"ignoreOptions": undefined,
"ignorePrefix": "-",
"layoutTransition": Object {
"mode": "out-in",