Skip to content
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