Fixed ignore in readme for babel-register [skip ci] (#6899)
This commit is contained in:
parent
041dd4a536
commit
0056fb1cfb
@ -39,7 +39,7 @@ override this by passing an ignore regex via:
|
||||
require("@babel/register")({
|
||||
// This will override `node_modules` ignoring - you can alternatively pass
|
||||
// an array of strings to be explicitly matched or a regex / glob
|
||||
ignore: false
|
||||
ignore: []
|
||||
});
|
||||
```
|
||||
|
||||
@ -49,16 +49,16 @@ require("@babel/register")({
|
||||
require("@babel/register")({
|
||||
// Optional ignore regex - if any filenames **do** match this regex then they
|
||||
// aren't compiled.
|
||||
ignore: /regex/,
|
||||
ignore: [/regex/],
|
||||
|
||||
// Ignore can also be specified as a function.
|
||||
ignore: function(filename) {
|
||||
ignore: [function(filename) {
|
||||
if (filename === "/path/to/es6-file.js") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
}],
|
||||
|
||||
// Optional only regex - if any filenames **don't** match this regex then they
|
||||
// aren't compiled
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user