Skip to content

Commit

Permalink
Build separate bundles for publishing on GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
borodean committed Feb 13, 2020
1 parent aa5019b commit 6919732
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.npmignore
.travis.yml
borodean-jsonp-*.tgz
dist/*-*.*.*.min.*
karma.conf.js
rollup.config.js
test
13 changes: 9 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ import commonjs from '@rollup/plugin-commonjs';
import filesize from 'rollup-plugin-filesize';
import {uglify} from 'rollup-plugin-uglify';

import {version} from './package.json';

const name = 'jsonp';

const createInput = (input, output) => ({
const createInput = (input, outputBasename) => ({
input,
output: createOutput(`dist/${output}`),
output: [
createOutput(`dist/${outputBasename}.min.js`),
createOutput(`dist/${outputBasename}-${version}.min.js`)
],
plugins: [
commonjs(),
filesize(),
Expand All @@ -30,6 +35,6 @@ const createOutput = file => ({
});

export default [
createInput('callback.js', `${name}.min.js`),
createInput('promise.js', `${name}-promise.min.js`)
createInput('callback.js', name),
createInput('promise.js', `${name}-promise`)
];

0 comments on commit 6919732

Please sign in to comment.