Skip to content

Instantly share code, notes, and snippets.

@jbeda
Last active August 19, 2021 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbeda/45dc86d46101419dd8c6f23d4f05f077 to your computer and use it in GitHub Desktop.
Save jbeda/45dc86d46101419dd8c6f23d4f05f077 to your computer and use it in GitHub Desktop.
Using rollup to bundle modules for copy/paste into cuttle.xyz

Playing around using rollup to bundle things for copy/paste into cuttle.xyz.

npm install
rollup -c

copy/paste bundle.js

import { Delaunay, Voronoi } from 'd3-delaunay';
export { Delaunay, Voronoi };
{
"dependencies": {
"d3-delaunay": "^6.0.2"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.0.4"
}
}
import resolve from '@rollup/plugin-node-resolve';
export default {
input: 'main.js',
output: {
file: 'bundle.js',
format: 'iife',
name: 'ext'
},
plugins: [ resolve() ]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment