jsdf / browserify-incremental

incremental rebuild for browserify
175 stars 13 forks source link

Exposed module requiring other exposed module results in error when using cache #22

Open thedufer opened 8 years ago

thedufer commented 8 years ago

For a minimal example, put in file a.js:

module.exports = 'hi';

And in file b.js:

module.exports = require('a');

And compile with browserifyinc --require ./a.js:a --require ./b.js:b. The first time this works fine; the second (after filling the cache) it results in Error: ENOENT, open 'a'. This is because the cache contains

      "deps": {
        "a": "a"
      }

We should not try to open that, since it is a module name and not a file path.

console.log(require('a'))
console.log(require('b'))

And then compile with browserifyinc --external a --external b c.js. When run after the first bundle, this will print 'hi' twice.

thedufer commented 8 years ago

This might actually be a browserify issue. I've submitted a PR there, so we'll see.

VanCoding commented 7 years ago

I've opened a ticket on browserify-cache-api that might be related to this: https://github.com/jsdf/browserify-cache-api/issues/10