mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #8050 from yurydelendik/systemjs
Replaces RequireJS to SystemJS.
This commit is contained in:
commit
25f772a255
15 changed files with 118 additions and 64 deletions
|
@ -15,21 +15,20 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
|
||||
// Patch importScripts to work around a bug in WebKit and Chrome 48-.
|
||||
// See https://crbug.com/572225 and https://webkit.org/b/153317.
|
||||
self.importScripts = (function (importScripts) {
|
||||
return function() {
|
||||
setTimeout(function () {}, 0);
|
||||
return importScripts.apply(this, arguments);
|
||||
};
|
||||
})(importScripts);
|
||||
}
|
||||
// Patch importScripts to work around a bug in WebKit and Chrome 48-.
|
||||
// See https://crbug.com/572225 and https://webkit.org/b/153317.
|
||||
self.importScripts = (function (importScripts) {
|
||||
return function() {
|
||||
setTimeout(function () {}, 0);
|
||||
return importScripts.apply(this, arguments);
|
||||
};
|
||||
})(importScripts);
|
||||
|
||||
importScripts('../node_modules/requirejs/require.js');
|
||||
importScripts('./shared/compatibility.js');
|
||||
importScripts('../node_modules/systemjs/dist/system.js');
|
||||
importScripts('../systemjs.config.js');
|
||||
|
||||
require.config({paths: {'pdfjs': '.'}});
|
||||
require(['pdfjs/core/network', 'pdfjs/core/worker'],
|
||||
function (network, worker) {
|
||||
Promise.all([SystemJS.import('pdfjs/core/network'),
|
||||
SystemJS.import('pdfjs/core/worker')]).then(function () {
|
||||
// Worker is loaded at this point.
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue