Update README.md (#7140)
This commit is contained in:
parent
820edd1e23
commit
82c6ca2f96
@ -47,18 +47,17 @@ require("@babel/register")({
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
require("@babel/register")({
|
require("@babel/register")({
|
||||||
// Optional ignore regex - if any filenames **do** match this regex then they
|
// Array of ignore conditions, either a regex or a function. (Optional)
|
||||||
// aren't compiled.
|
ignore: [
|
||||||
ignore: [/regex/],
|
// When a file path matches this regex then it is **not** compiled
|
||||||
|
/regex/,
|
||||||
|
|
||||||
// Ignore can also be specified as a function.
|
// The file's path is also passed to any ignore functions. It will
|
||||||
ignore: [function(filename) {
|
// **not** be compiled if `true` is returned.
|
||||||
if (filename === "/path/to/es6-file.js") {
|
function (filepath) {
|
||||||
return false;
|
return filepath !== "/path/to/es6-file.js";
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}],
|
],
|
||||||
|
|
||||||
// Optional only regex - if any filenames **don't** match this regex then they
|
// Optional only regex - if any filenames **don't** match this regex then they
|
||||||
// aren't compiled
|
// aren't compiled
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user