1
0
Fork 0
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:
Yury Delendik 2015-12-23 17:46:08 -06:00
parent e8db825512
commit cbbb9bb82d
6 changed files with 77 additions and 39 deletions

View file

@ -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';