On 16/04/14 16:35, Tom Hughes wrote:
I have an existing package that has a new version with a dependency on lodash-node so I was trying to package it but ran into the question of exactly what it is and how to deal with it...
We have lodash packaged already and as bast I can figure out lodash-node is the result of using lodash-cli to build node modules from lodash. Though I'm not sure what that means when lodash is already a node module?!?
In any case does that mean I should package lodash-cli first and then make the lodash-node package do that build step?
lodash-cli allows commands like this:
$ lodash compat $ lodash underscore $ lodash modern
The file created by each of the above contain a subset of lodash functionality tailored to whatever preset you've chosen.
lodash-node contains three subsets (compat, underscore, modern), but splits every single routine/function/method into a separate file. This allows individual methods to be required:
var isEqual = require('lodash-node/modern/objects/isEqual');
The lodash-node module can be re-built by doing this:
$ lodash modularize compat -o compat $ lodash modularize underscore -o underscore $ lodash modularize modern -o modern
So you'll probably need to package lodash-cli first, remove lodash-node/{compat,modern,underscore}, and rebuild using the above commands.
That's my understanding anyway. I, err, could be wrong about all of the above..
Kind regards,