Saturday, 10 August 2013

How to ignore libraries in browserify programmatic api

How to ignore libraries in browserify programmatic api

Assume the below code is found in bundler.js and tracing entry.js leads to
var B = require('backbone'); (Backbone is a dependency installed as
declared in package.json).
var browserify = require('browserify');
var bundle = new browserify();
bundle.add('entry.js');
bundle.bundle({
noParse: ['backbone']
});
Executing this bundler yields a stream that contains the original backbone
source. Based on browserify's command line options I expected it to skip
backbone alltogether.
Is it possible to use --noparse=FILE as a configuration option in this
application of the api?

No comments:

Post a Comment