mozilla/pdf.js — pull request #4025 by gjuggler (2013-12-12 14:18:34+00:00)
Title: Add singlefile build target

Adds a 'singlefile' target in make.js, which concatenates pdf.js and pdf.worker.js into a single pdf.combined.js file within the singlefile build directory.

A SINGLE_FILE preprocessor define is also set, which adjusts the workerSrc loading code to not attempt to load an external pdf.worker.js file and instead immediately resolve the promise.

Note: this is a second attempt at implementing the use case described in https://github.com/mozilla/pdf.js/pull/3947 . I'm not sure if I used the right #if / #else preprocessor syntax, but the builder doesn't seem to support #elsif, which would have led to more natural code there. Happy to take other advice / feedback into account here.