Package Exports
- libjs-loader
- libjs-loader/bundles/index.js
- libjs-loader/fesm2015/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (libjs-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
LibJs Loader
Provides a method for lazy loading of js libraries in the browser.
Installation
npm i libjs-loaderUsing
import { loadLibrary } from 'libjs-loader';
loadLibrary(
'https://mozilla.github.io/pdf.js/build/pdf.js',
'pdfjs-dist/build/pdf',
(pdfLib: any) => {
const pdfWorker = 'https://mozilla.github.io/pdf.js/build/pdf.worker.js';
pdfLib.GlobalWorkerOptions.workerSrc = pdfWorker;
pdfLib.loadScript(pdfWorker);
})
.then(pdf => {
const loadingTask = pdf.getDocument('pdf url');
...
});