Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs and add test: ignore and only take arrays as arguments #290

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ $ browserify -t [ babelify --sourceMapsAbsolute ]
browserify().transform(babelify.configure({
// Optional ignore regex - if any filenames **do** match this regex then
// they aren't compiled
ignore: /regex/,
ignore: [/regex/],

// Optional only regex - if any filenames **don't** match this regex
// then they aren't compiled
only: /my_es6_folder/
only: [/my_es6_folder/]
}))
```

Expand Down Expand Up @@ -192,7 +192,7 @@ Another solution (proceed with caution!) is to run babelify as a [global](https:
```js
browserify().transform("babelify", {
global: true,
ignore: /\/node_modules\/(?!app\/)/
ignore: [/\/node_modules\/(?!app\/)/]
});
```

Expand Down
8 changes: 6 additions & 2 deletions test/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ test('passes options via configure', function(t) {

b.transform(babelify.configure({
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-transform-property-literals']
plugins: ['@babel/plugin-transform-property-literals'],
ignore: [/fakeregex/],
only: [/index.js$/, /a.js$/, /b.js$/, /c.js$/]
}));

b.bundle(function (err, src) {
Expand All @@ -27,7 +29,9 @@ test('passes options via browserify', function(t) {

b.transform(babelify, {
presets: ['@babel/preset-env'],
plugins: ['@babel/plugin-transform-property-literals']
plugins: ['@babel/plugin-transform-property-literals'],
ignore: [/fakeregex/],
only: [/index.js$/, /a.js$/, /b.js$/, /c.js$/]
});

b.bundle(function (err, src) {
Expand Down