require('canvas') statement breaks Browserify or RequireJS builds #28

Closed
bvalosek opened this Issue Jan 10, 2014 · 2 comments

Comments

2 participants
@bvalosek

The conditional require('canvas') statement on line 388 causes the build to break when using Browserify or the RequireJS optimizer.

This happens because the build tools look through the source and find all calls to require() and attempt to eagerly include them, since whether or not the code would actually execute is cannot be known at built time.

This means Browserify / RequireJS attempt to resolve the canvas module, which isn't found (or needed, as we are targeting the browser).

Removal of the require() call fixes this issue.

@zakangelle

This comment has been minimized.

Show comment
Hide comment
@zakangelle

zakangelle Jan 10, 2014

What this dude said.

What this dude said.

@bvalosek

This comment has been minimized.

Show comment
Hide comment
@bvalosek

bvalosek Jan 11, 2014

Perfect, thanks

Perfect, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment