Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows to pull pdf.js from pdf_viewer using require(). #8087

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions web/pdfjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals module */
/* globals module, __pdfjsdev_webpack__ */
/* umdutils ignore */

'use strict';

if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('PRODUCTION')) {
module.exports = window['pdfjs-dist/build/pdf']; // loaded via html script tag
var pdfjsLib;
// The if below protected by __pdfjsdev_webpack__ check from webpack parsing.
if (typeof __pdfjsdev_webpack__ === 'undefined') {
if (typeof require === 'function') {
pdfjsLib = require('../build/pdf.js'); // using a bundler to pull the core
} else {
pdfjsLib = window['pdfjs-dist/build/pdf']; // loaded via html script tag
}
}
module.exports = pdfjsLib;
} else {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
Expand Down