danprince / zaphod

🌌 Clojure's API for JavaScript's Objects
https://zaphod.surge.sh
MIT License
54 stars 1 forks source link

code splitting prepublish step #11

Open danprince opened 8 years ago

danprince commented 8 years ago

Publish with split code like lodash does.

import { assoc } from 'zaphod';
// vs
import assoc from 'zaphod/assoc';

This will allow users to create small bundles without needing a tree-shaking bundler. I suppose that the simplest way to do this without splitting up the main source file will be to create the individual bundles with rollup. E.g.

// assoc.js
import { assoc} from '../src';
export default assoc

Should be able to generate these files automatically as part of the build process.

Not currently a priority as the standalone unminified bundle is only 3kb.