Update README.md (#7140)

This commit is contained in:
Elad Chen 2018-01-03 17:59:46 +02:00 committed by Brian Ng
parent 820edd1e23
commit 82c6ca2f96

View File

@ -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