Skip to content

Commit 816a84f

Browse files
committed
Reorder build process
1 parent 9ccdc0c commit 816a84f

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

rollup.config.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ function license(filename) {
2020
}
2121

2222
export default [
23-
// Bundled builds.
23+
// Un-bundled builds.
2424
{
2525
name: 'html2pdf',
2626
input: 'src/index.js',
2727
output: [
28-
{ file: pkg.browser.replace(/js$/, 'bundle.js'), format: 'umd' }
28+
{ file: pkg.main, format: 'cjs' },
29+
{ file: pkg.module, format: 'es' },
30+
{ file: pkg.browser, format: 'umd' }
31+
],
32+
external: [
33+
'jspdf',
34+
'html2canvas',
35+
'es6-promise/auto'
2936
],
3037
globals: {
3138
jspdf: 'jsPDF',
@@ -38,14 +45,12 @@ export default [
3845
banner()
3946
]
4047
},
41-
// Un-bundled builds.
48+
// Un-bundled builds (minified).
4249
{
4350
name: 'html2pdf',
4451
input: 'src/index.js',
4552
output: [
46-
{ file: pkg.main, format: 'cjs' },
47-
{ file: pkg.module, format: 'es' },
48-
{ file: pkg.browser, format: 'umd' }
53+
{ file: pkg.browser.replace(/js$/, 'min.js'), format: 'umd' }
4954
],
5055
external: [
5156
'jspdf',
@@ -60,15 +65,17 @@ export default [
6065
resolve(),
6166
commonjs(),
6267
babel({ exclude: 'node_modules/**' }),
63-
banner()
68+
uglify({
69+
output: { preamble: banner().banner }
70+
})
6471
]
6572
},
66-
// Bundled builds (minified).
73+
// Bundled builds.
6774
{
6875
name: 'html2pdf',
6976
input: 'src/index.js',
7077
output: [
71-
{ file: pkg.browser.replace(/js$/, 'bundle.min.js'), format: 'umd' }
78+
{ file: pkg.browser.replace(/js$/, 'bundle.js'), format: 'umd' }
7279
],
7380
globals: {
7481
jspdf: 'jsPDF',
@@ -78,22 +85,15 @@ export default [
7885
resolve(),
7986
commonjs(),
8087
babel({ exclude: 'node_modules/**' }),
81-
uglify({
82-
output: { preamble: banner().banner }
83-
})
88+
banner()
8489
]
8590
},
86-
// Un-bundled builds (minified).
91+
// Bundled builds (minified).
8792
{
8893
name: 'html2pdf',
8994
input: 'src/index.js',
9095
output: [
91-
{ file: pkg.browser.replace(/js$/, 'min.js'), format: 'umd' }
92-
],
93-
external: [
94-
'jspdf',
95-
'html2canvas',
96-
'es6-promise/auto'
96+
{ file: pkg.browser.replace(/js$/, 'bundle.min.js'), format: 'umd' }
9797
],
9898
globals: {
9999
jspdf: 'jsPDF',

0 commit comments

Comments
 (0)