1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 23:58:07 +02:00

Replaces RequireJS to SystemJS.

This commit is contained in:
Yury Delendik 2017-02-09 09:53:52 -06:00
parent 54e86f441b
commit 5b50e0d414
15 changed files with 118 additions and 64 deletions

View file

@ -53,7 +53,8 @@ See https://github.com/adobe-type-tools/cmap-resources
<!--#endif-->
<!--#if !PRODUCTION-->
<script src="../node_modules/requirejs/require.js"></script>
<script src="../node_modules/systemjs/dist/system.js"></script>
<script src="../systemjs.config.js"></script>
<!--#endif-->
<!--#if (GENERIC && !MINIFIED) -->

View file

@ -171,10 +171,12 @@ function getViewerConfiguration() {
function webViewerLoad() {
var config = getViewerConfiguration();
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
require.config({paths: {'pdfjs': '../src', 'pdfjs-web': '.'}});
require(['pdfjs-web/app', 'pdfjs-web/pdf_print_service'], function (web) {
window.PDFViewerApplication = web.PDFViewerApplication;
web.PDFViewerApplication.run(config);
Promise.all([SystemJS.import('pdfjs-web/app'),
SystemJS.import('pdfjs-web/pdf_print_service')])
.then(function (modules) {
var app = modules[0];
window.PDFViewerApplication = app.PDFViewerApplication;
app.PDFViewerApplication.run(config);
});
} else {
window.PDFViewerApplication = pdfjsWebApp.PDFViewerApplication;