Skip to content

Commit

Permalink
Split bundle into seperate entries: index-iife, index-es
Browse files Browse the repository at this point in the history
  • Loading branch information
garygreen committed Apr 20, 2019
1 parent dad015a commit 8a86884
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions index-es.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Sortable from './Sortable';

export default Sortable;

export {
Sortable
}
3 changes: 3 additions & 0 deletions index-iife.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Sortable from './Sortable';

export default Sortable;
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"description": "JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap.",
"main": "Sortable.js",
"module": "index-es.js",
"scripts": {
"prepublish": "npm run build",
"build": "rollup -c rollup.config.js && npm run min",
Expand Down
8 changes: 5 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import json from 'rollup-plugin-json';

export default {
input: 'Sortable.js',
export default [
{
input: 'index-iife.js',
output: {
file: 'dist/sortable.js',
format: 'iife',
name: 'Sortable'
},
plugins: [json()]
};
}
];

0 comments on commit 8a86884

Please sign in to comment.