diff --git a/README.md b/README.md index 69bc8e6..b6904b2 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,19 @@ bundler.transform({ bundler.bundle().pipe(process.stdout) ``` +For any files/directories containing a dot, you can pass in the `dot: true` +[option for minimatch](https://github.com/isaacs/minimatch#dot) + +```javascript +bundler.transform({ + global: true, + ignore: [ + '**/node_modules/sql.js/**' + ], + dot: true +}, 'uglifyify') +``` + ## Source Maps Uglifyify supports source maps, so you can minify your code and still see the diff --git a/index.js b/index.js index 7f4115e..56ab27b 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ function uglifyify(file, opts) { delete opts._flags - if (ignore(file, opts.ignore)) { + if (ignore(file, opts.ignore, opts.dot)) { return through() } @@ -102,13 +102,15 @@ function uglifyify(file, opts) { } } -function ignore(file, list) { +function ignore(file, list, dot) { if (!list) return list = Array.isArray(list) ? list : [list] return list.some(function(pattern) { - var match = minimatch(pattern) + var match = minimatch(pattern, { + dot: dot + }) return match.match(file) }) }