File tree Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Expand file tree Collapse file tree 1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change 2
2
import resolve from 'rollup-plugin-node-resolve' ;
3
3
import commonjs from 'rollup-plugin-commonjs' ;
4
4
import babel from 'rollup-plugin-babel' ;
5
+ import uglify from 'rollup-plugin-uglify' ;
5
6
import pkg from './package.json' ;
6
7
7
8
function banner ( ) {
@@ -61,5 +62,50 @@ export default [
61
62
babel ( { exclude : 'node_modules/**' } ) ,
62
63
banner ( )
63
64
]
65
+ } ,
66
+ // Bundled builds (minified).
67
+ {
68
+ name : 'html2pdf' ,
69
+ input : 'src/index.js' ,
70
+ output : [
71
+ { file : pkg . browser . replace ( / j s $ / , 'bundle.min.js' ) , format : 'umd' }
72
+ ] ,
73
+ globals : {
74
+ jspdf : 'jsPDF' ,
75
+ html2canvas : 'html2canvas'
76
+ } ,
77
+ plugins : [
78
+ resolve ( ) ,
79
+ commonjs ( ) ,
80
+ babel ( { exclude : 'node_modules/**' } ) ,
81
+ uglify ( {
82
+ output : { preamble : banner ( ) . banner }
83
+ } )
84
+ ]
85
+ } ,
86
+ // Un-bundled builds (minified).
87
+ {
88
+ name : 'html2pdf' ,
89
+ input : 'src/index.js' ,
90
+ output : [
91
+ { file : pkg . browser . replace ( / j s $ / , 'min.js' ) , format : 'umd' }
92
+ ] ,
93
+ external : [
94
+ 'jspdf' ,
95
+ 'html2canvas' ,
96
+ 'es6-promise/auto'
97
+ ] ,
98
+ globals : {
99
+ jspdf : 'jsPDF' ,
100
+ html2canvas : 'html2canvas'
101
+ } ,
102
+ plugins : [
103
+ resolve ( ) ,
104
+ commonjs ( ) ,
105
+ babel ( { exclude : 'node_modules/**' } ) ,
106
+ uglify ( {
107
+ output : { preamble : banner ( ) . banner }
108
+ } )
109
+ ]
64
110
}
65
111
] ;
You can’t perform that action at this time.
0 commit comments