Closed wooorm closed 9 years ago
Hmm. I actually found that browserify’s similar --ignore
works: browserify index.js --ignore unicode/category/So -s Something > something.js
*, as ignore
returns an object for an ignored require!
* where something.js
just exposes window.slug = require('slug')
.
By wrapping the
require
call in a try/catch statement, runningslug
will work with browserified CommonJS dependants.So even when
require
is available, a missingunicode/category/So
will not fail the process. Such a file is missing when, for example,browserify
is run with--exclude
.Note: the test failed on this, but that seems to happen due to failures on the master branch.