mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Adds UMD header to pdf.js and pdf.worker.js files.
This commit is contained in:
parent
e8db825512
commit
cbbb9bb82d
6 changed files with 77 additions and 39 deletions
3
external/umdutils/verifier.js
vendored
3
external/umdutils/verifier.js
vendored
|
@ -55,6 +55,9 @@ var path = require('path');
|
|||
*/
|
||||
function parseUmd(filePath) {
|
||||
var jscode = fs.readFileSync(filePath).toString();
|
||||
if (/\/\*\s*umdutils\s+ignore\s*\*\//.test(jscode)) {
|
||||
throw new Error('UMD processing ignored');
|
||||
}
|
||||
// Extracts header and body.
|
||||
var umdStart = '\\(function\\s\\(root,\\sfactory\\)\\s\\{';
|
||||
var umdImports = '\\}\\(this,\\sfunction\\s\\(exports\\b';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue