17 lines
468 B
JavaScript
17 lines
468 B
JavaScript
|
|
const replacements = [
|
||
|
|
["__webpack_exports__", "__pdfjs_dist_exports__"],
|
||
|
|
["__webpack_module_cache__", "__pdfjs_dist_module_cache__"],
|
||
|
|
["__webpack_modules__", "__pdfjs_dist_modules__"],
|
||
|
|
["__webpack_require__", "__pdfjs_dist_require__"],
|
||
|
|
];
|
||
|
|
|
||
|
|
module.exports = function pdfjsDistPatchLoader(source) {
|
||
|
|
let patchedSource = source;
|
||
|
|
|
||
|
|
for (const [from, to] of replacements) {
|
||
|
|
patchedSource = patchedSource.split(from).join(to);
|
||
|
|
}
|
||
|
|
|
||
|
|
return patchedSource;
|
||
|
|
};
|