Skip to content

Commit

Permalink
Add Rollup config
Browse files Browse the repository at this point in the history
  • Loading branch information
eKoopmans committed Nov 20, 2017
1 parent b7c1ee7 commit d215e2a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 5 deletions.
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
"name": "html2pdf",
"version": "0.7.6",
"description": "Client-side HTML-to-PDF rendering using pure JS",
"main": "dist/html2pdf.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"main": "dist/require/html2pdf.cjs.js",
"module": "dist/include/html2pdf.es.js",
"browser": "dist/html2pdf.js",
"repository": {
"type": "git",
"url": "git+https://github.com/eKoopmans/html2pdf.git"
Expand All @@ -29,6 +28,13 @@
"homepage": "https://github.com/eKoopmans/html2pdf",
"dependencies": {
"html2canvas": "https://github.com/eKoopmans/html2canvas/tarball/develop",
"jspdf": "1.3.5"
"jspdf": "^1.3.5"
},
"devDependencies": {
"rollup": "^0.51.8"
},
"scripts": {
"build": "npm install && rollup -c",
"test": "echo \"Error: no test specified\" && exit 1"
}
}
27 changes: 27 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Import dependencies.
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import pkg from './package.json';

export default [
// Bundled builds.
{
input: 'src/index.js',
output: [
{ file: pkg.main.replace(/js$/, 'bundle.js'), format: 'cjs' },
{ file: pkg.module.replace(/js$/, 'bundle.js'), format: 'es' },
{ file: pkg.browser.replace(/js$/, 'bundle.js'), format: 'iife' },
{ file: pkg.browser.replace(/js$/, 'umd.bundle.js'), format: 'umd' }
]
},
// Un-bundled builds.
{
input: 'src/index.js',
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' },
{ file: pkg.browser, format: 'iife' },
{ file: pkg.browser.replace(/js$/, 'umd.js'), format: 'umd' }
]
}
];

0 comments on commit d215e2a

Please sign in to comment.