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.
Note: The module.exports setting is irrelevant, but useful if you want to see that this is a meaningful thing to do. In file c.js:
For a minimal example, put in file
a.js
:And in file
b.js
: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 inError: ENOENT, open 'a'
. This is because the cache containsWe should not try to open that, since it is a module name and not a file path.
module.exports
setting is irrelevant, but useful if you want to see that this is a meaningful thing to do. In filec.js
:And then compile with
browserifyinc --external a --external b c.js
. When run after the first bundle, this will print'hi'
twice.