@@ -15,9 +15,7 @@ function monkeyPatch() {
15
15
var file = id . split ( '/' ) . pop ( ) ;
16
16
if ( file === 'adler32cs.js' ) {
17
17
code = code . replace ( / t h i s , f u n c t i o n / g, 'jsPDF, function' ) ;
18
- code = code . replace ( / t y p e o f d e f i n e / g, '0' ) ;
19
- } else if ( file === 'FileSaver.js' ) {
20
- code = code . replace ( / d e f i n e ! = = n u l l \) & & \( d e f i n e .a m d ! = n u l l / g, '0' ) ;
18
+ code = code . replace ( / r e q u i r e \( ' b u f f e r ' \) / g, '{}' ) ;
21
19
}
22
20
return code ;
23
21
}
@@ -26,8 +24,8 @@ function monkeyPatch() {
26
24
27
25
// Rollup removes local variables unless used within a module.
28
26
// This plugin makes sure specified local variables are preserved
29
- // and kept local. This plugin won 't be necessary once es2015
30
- // modules are used.
27
+ // and kept local. This plugin wouldn 't be necessary if es2015
28
+ // modules would be used.
31
29
function rawjs ( opts ) {
32
30
opts = opts || { } ;
33
31
return {
@@ -64,7 +62,7 @@ function bundle(paths) {
64
62
} )
65
63
]
66
64
} ) . then ( function ( bundle ) {
67
- var code = bundle . generate ( { format : 'umd' } ) . code ;
65
+ var code = bundle . generate ( { format : 'umd' , moduleName : 'jspdf' } ) . code ;
68
66
code = code . replace ( / P e r m i s s i o n \s + i s \s + h e r e b y \s + g r a n t e d [ \S \s ] + ?I N \s + T H E \s + S O F T W A R E \. / , 'Licensed under the MIT License' ) ;
69
67
code = code . replace ( / P e r m i s s i o n \s + i s \s + h e r e b y \s + g r a n t e d [ \S \s ] + ?I N \s + T H E \s + S O F T W A R E \. / g, '' ) ;
70
68
fs . writeFileSync ( paths . debug , renew ( code ) ) ;
0 commit comments