perfBar
perfBar copied to clipboard
Make it browserifiable.
- Build with
--standaloneoption andderequireplugin. - Rebuild assets.
[Resolves #24]
What does derequire actually do?
Derequire parses the JS and maps all instances of require to some other token, defaulting to _dereq_. This is necessary when you want to browserify a dependency that has already been browserified, which is the problem behind #24--otherwise the second pass through browserify will see a bunch of require statements from the first pass and try to resolve them, which will fail. Apparently the --standalone option in browserify used to do this automatically but now doesn't, although it looks like that's about to happen again.
There are a couple of long discussions about this among the browserify team here: https://github.com/substack/node-browserify/pull/1151 https://github.com/substack/node-browserify/issues/374
Isn't exposing perfBar on module.exports enough? and loading lib/perfBar.js instead of loading bundle/perfBar.js?