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 22import resolve from 'rollup-plugin-node-resolve' ;
33import commonjs from 'rollup-plugin-commonjs' ;
44import babel from 'rollup-plugin-babel' ;
5+ import uglify from 'rollup-plugin-uglify' ;
56import pkg from './package.json' ;
67
78function banner ( ) {
@@ -61,5 +62,50 @@ export default [
6162 babel ( { exclude : 'node_modules/**' } ) ,
6263 banner ( )
6364 ]
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+ ]
64110 }
65111] ;
You can’t perform that action at this time.
0 commit comments