mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Replaces RequireJS to SystemJS.
This commit is contained in:
parent
54e86f441b
commit
5b50e0d414
15 changed files with 118 additions and 64 deletions
|
@ -1,8 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
// In production, the bundled pdf.js shall be used instead of RequireJS.
|
||||
require.config({paths: {'pdfjs': '../../src'}});
|
||||
require(['pdfjs/display/api', 'pdfjs/display/global'], function (api, global) {
|
||||
// In production, the bundled pdf.js shall be used instead of SystemJS.
|
||||
Promise.all([SystemJS.import('pdfjs/display/api'),
|
||||
SystemJS.import('pdfjs/display/global')])
|
||||
.then(function (modules) {
|
||||
var api = modules[0], global = modules[1];
|
||||
// In production, change this to point to the built `pdf.worker.js` file.
|
||||
global.PDFJS.workerSrc = '../../src/worker_loader.js';
|
||||
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<script src="../../node_modules/requirejs/require.js"></script>
|
||||
<script src="../../node_modules/systemjs/dist/system.js"></script>
|
||||
<script src="../../systemjs.config.js"></script>
|
||||
<script src="hello.js"></script>
|
||||
</head>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue