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 { export default class Ignore {
constructor (options) { constructor (options) {
this.rootDir = options.rootDir this.rootDir = options.rootDir
this.ignoreOptions = options.ignoreOptions
this.addIgnoresRules() this.addIgnoresRules()
} }
@ -17,7 +18,7 @@ export default class Ignore {
const ignoreFile = path.resolve(this.rootDir, Ignore.IGNORE_FILENAME) const ignoreFile = path.resolve(this.rootDir, Ignore.IGNORE_FILENAME)
if (fs.existsSync(ignoreFile) && fs.statSync(ignoreFile).isFile()) { if (fs.existsSync(ignoreFile) && fs.statSync(ignoreFile).isFile()) {
this.ignoreFile = ignoreFile this.ignoreFile = ignoreFile
this.ignore = ignore() this.ignore = ignore(this.ignoreOptions)
} }
} }
return this.ignoreFile return this.ignoreFile

View File

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

View File

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

View File

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