tfilter
selectively run browserify transforms using globs or a filter function
it is different from most other transform filter packages in that this can be used simply from the CLI.
Install
npm install tfilter
Usage
browserify -t [ tfilter --include '*.js' brfs ]
browserify -t [ tfilter --exclude '**/*.json' envify --NODE_ENV production ]
--include
Files matching this glob will be transformed. Other files will not be.
--exclude
Files matching this glob will not be transformed. Other files will be.
Using both --include
and --exclude
means both conditions apply: A file path must match the --include
glob and must not match the --exclude
glob in order to be transformed.
Node API
Call tfilter
with a transform function in the first parameter, and options in the second parameter.
tfilter(transform, opts)
will return a new transform function that can be passed to browserify.
var babelify = var tfilter = b
include: '' or /./
Files matching this glob or Regex will be transformed.
exclude: '' or /./
Files matching this glob or Regex will not be transformed.
filter: function (filename) {}
Check if filename
should be transformed, with some custom logic. If given, include
and exclude
are not considered.