Replaces RequireJS to SystemJS.
This commit is contained in:
parent
54e86f441b
commit
5b50e0d414
15 changed files with 118 additions and 64 deletions
|
@ -36,10 +36,11 @@ function renderDocument(pdf, svgLib) {
|
|||
}
|
||||
}
|
||||
|
||||
// In production, the bundled pdf.js shall be used instead of RequireJS.
|
||||
require.config({paths: {'pdfjs': '../../src'}});
|
||||
require(['pdfjs/display/api', 'pdfjs/display/svg', 'pdfjs/display/global'],
|
||||
function (api, svg, global) {
|
||||
Promise.all([SystemJS.import('pdfjs/display/api'),
|
||||
SystemJS.import('pdfjs/display/svg'),
|
||||
SystemJS.import('pdfjs/display/global')])
|
||||
.then(function (modules) {
|
||||
var api = modules[0], svg = modules[1], global = modules[2];
|
||||
// In production, change this to point to the built `pdf.worker.js` file.
|
||||
global.PDFJS.workerSrc = '../../src/worker_loader.js';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue