perfBar icon indicating copy to clipboard operation
perfBar copied to clipboard

Make it browserifiable.

Open jmcarp opened this issue 10 years ago • 3 comments

  • Build with --standalone option and derequire plugin.
  • Rebuild assets.

[Resolves #24]

jmcarp avatar Jun 05 '15 00:06 jmcarp

What does derequire actually do?

lafikl avatar Jun 12 '15 15:06 lafikl

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

jmcarp avatar Jun 12 '15 16:06 jmcarp

Isn't exposing perfBar on module.exports enough? and loading lib/perfBar.js instead of loading bundle/perfBar.js?

lafikl avatar Jun 12 '15 16:06 lafikl