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:
parent
0b99b3f6f1
commit
6b5a016c59
2
index.js
2
index.js
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue