sutoiku/formula.js — pull request #30 by hmalphettes (2014-09-11 02:38:07+00:00)
Title: produce a browser build without lodash and moment

We need to create a bundle that the browser can consume.

At CrowdProcess @joaojeronimo and and @miguelvps had removed the dependencies on moment and lodash and made a browserify build.

@jalateras had to put back lodash and moment to support all the functions we need.
So the browser bundle is now 800Kb when not minimised and contains lodash and moment.

In our own product and I suspect in many situations, we dont need moment and lodash: they should be declared as external.

I attempted to generate such a bundle with browserify:
```
@$(browserify) index.js -o build/formula.js -x moment -x lodash -s formula
```
When we consume this bundle in our product it fails:
```
Uncaught Error: Module name "moment" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded require.js:184makeError require.js:184localRequire require.js:1418requirejs require.js:1763s stoic.api.build.js:82721(anonymous function)
```

Using webpack it works fine.