Skip to content

Commit 9ccdc0c

Browse files
committed
Add uglify to build process
1 parent 3ef8f82 commit 9ccdc0c

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

rollup.config.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import resolve from 'rollup-plugin-node-resolve';
33
import commonjs from 'rollup-plugin-commonjs';
44
import babel from 'rollup-plugin-babel';
5+
import uglify from 'rollup-plugin-uglify';
56
import pkg from './package.json';
67

78
function 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(/js$/, '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(/js$/, '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
];

0 commit comments

Comments
 (0)