bundle-bundle-external.js 703 B

12345678910111213141516171819202122232425262728293031
  1. var browserify = require('../');
  2. var test = require('tap').test;
  3. var pubdir = __dirname;
  4. var dir = pubdir + '/bundle-bundle-external';
  5. var opt = {
  6. debug: true,
  7. basedir: pubdir,
  8. exposeAll: true
  9. };
  10. test('bundle bundle external', function (t) {
  11. t.plan(1);
  12. var bundle1 = browserify(opt);
  13. var name = dir + '/foo.js';
  14. bundle1.require(name, { entry: true, expose: name, basedir: pubdir });
  15. var bundle2 = browserify({
  16. debug: true,
  17. basedir: pubdir,
  18. entries: [ dir + '/baz.js' ]
  19. });
  20. // adding and removing this line causes failure //
  21. //bundle2.external(bundle1);
  22. bundle2.bundle(function(err, src) {
  23. t.ifError(err);
  24. });
  25. });