Use full lodash instead of lodash components

This change trims 134 modules from the dependency tree, many of which
were duplicate depdencies between the 4 lodash.function modules used
and their sub-dependencies.

Before:
$ npm ls | wc -l
     494
$ du -sch node_modules/lodash*
 432K   node_modules/lodash.assign
 660K   node_modules/lodash.clonedeep
  96K   node_modules/lodash.defaults
 980K  node_modules/lodash.pick
 2.1M  total

After:
$ npm ls | wc -l
     360
$ du -sch node_modules/lodash*
964K   node_modules/lodash
964K   total
This commit is contained in:
Ryan Graham 2014-12-02 19:09:48 -08:00
parent 0b99b3f6f1
commit 6b5a016c59
9 changed files with 11 additions and 14 deletions

View File

@ -5,7 +5,7 @@
var url = require('url');
var path = require('path');
var urlJoin = require('./lib/url-join');
var _defaults = require('lodash.defaults');
var _defaults = require('lodash').defaults;
var express = require('express');
var swagger = require('./lib/swagger');
var SWAGGER_UI_ROOT = require('swagger-ui').dist;

View File

@ -3,8 +3,8 @@
/**
* Module dependencies.
*/
var _cloneDeep = require('lodash.clonedeep');
var _pick = require('lodash.pick');
var _cloneDeep = require('lodash').cloneDeep;
var _pick = require('lodash').pick;
var translateDataTypeKeys = require('./translate-data-type-keys');
var typeConverter = require('./type-converter');

View File

@ -5,8 +5,8 @@
*/
var debug = require('debug')('loopback:explorer:routeHelpers');
var _cloneDeep = require('lodash.clonedeep');
var _assign = require('lodash.assign');
var _cloneDeep = require('lodash').cloneDeep;
var _assign = require('lodash').assign;
var modelHelper = require('./model-helper');
var typeConverter = require('./type-converter');

View File

@ -9,7 +9,7 @@ module.exports = Swagger;
*/
var path = require('path');
var urlJoin = require('./url-join');
var _defaults = require('lodash.defaults');
var _defaults = require('lodash').defaults;
var classHelper = require('./class-helper');
var routeHelper = require('./route-helper');
var modelHelper = require('./model-helper');

View File

@ -4,7 +4,7 @@
* Module dependencies.
*/
var _cloneDeep = require('lodash.clonedeep');
var _cloneDeep = require('lodash').cloneDeep;
// Keys that are different between LDL and Swagger
var KEY_TRANSLATIONS = {

View File

@ -34,10 +34,7 @@
"cors": "^2.4.2",
"debug": "~1.0.3",
"express": "3.x",
"lodash.assign": "^2.4.1",
"lodash.clonedeep": "^2.4.1",
"lodash.defaults": "^2.4.1",
"lodash.pick": "^2.4.1",
"lodash": "^2.4.1",
"swagger-ui": "~2.0.18"
}
}

View File

@ -2,7 +2,7 @@
var classHelper = require('../lib/class-helper');
var expect = require('chai').expect;
var _defaults = require('lodash.defaults');
var _defaults = require('lodash').defaults;
describe('class-helper', function() {
it('joins array descriptions', function() {

View File

@ -1,7 +1,7 @@
'use strict';
var modelHelper = require('../lib/model-helper');
var _defaults = require('lodash.defaults');
var _defaults = require('lodash').defaults;
var loopback = require('loopback');
var expect = require('chai').expect;

View File

@ -2,7 +2,7 @@
var routeHelper = require('../lib/route-helper');
var expect = require('chai').expect;
var _defaults = require('lodash.defaults');
var _defaults = require('lodash').defaults;
describe('route-helper', function() {
it('returns "object" when a route has multiple return values', function() {