I am trying to use pdfjs-dist in a webpack script:
const PDFJS = require("pdfjs-dist/webpack");
var loadingTask = PDFJS.getDocument('hello.pdf');
loadingTask.promise.then(function(pdf) {
console.log(pdf);
// you can now use *pdf* here
});
Though it fails to build dumping an error:
./node_modules/worker-loader/dist/cjs.js!./node_modules/pdfjs-dist/build/pdf.worker.js
ModuleBuildError: Module build failed (from ./node_modules/worker-loader/dist/cjs.js):
Error: MainTemplate.hooks.hotBootstrap has been removed (use your own RuntimeModule instead)
I understand that MainTemplate.hooks.hotBootstrap has been removed in webpack 5, but is there a workaround for this? Are there any plans to support the latest webpack version?
I am trying to use
pdfjs-distin a webpack script:Though it fails to build dumping an error:
I understand that
MainTemplate.hooks.hotBootstraphas been removed in webpack 5, but is there a workaround for this? Are there any plans to support the latest webpack version?