Import subset of underscore.string scripts only
Require individual methods like `classify` instead of the whole module. This reduces the size of the browser bundle from ~27kb down to ~2kb.
This commit is contained in:
parent
911d8323b4
commit
7528cbb712
|
@ -8,7 +8,8 @@ var assert = require('assert');
|
|||
var fs = require('fs');
|
||||
var extend = require('util')._extend;
|
||||
var RemoteObjects = require('strong-remoting');
|
||||
var stringUtils = require('underscore.string');
|
||||
var classify = require('underscore.string/classify');
|
||||
var camelize = require('underscore.string/camelize');
|
||||
var path = require('path');
|
||||
|
||||
/**
|
||||
|
@ -361,14 +362,6 @@ app.boot = function(options) {
|
|||
'`app.boot` was removed, use the new module loopback-boot instead');
|
||||
};
|
||||
|
||||
function classify(str) {
|
||||
return stringUtils.classify(str);
|
||||
}
|
||||
|
||||
function camelize(str) {
|
||||
return stringUtils.camelize(str);
|
||||
}
|
||||
|
||||
function dataSourcesFromConfig(config, connectorRegistry) {
|
||||
var connectorPath;
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ var assert = require('assert');
|
|||
var RemoteObjects = require('strong-remoting');
|
||||
var SharedClass = require('strong-remoting').SharedClass;
|
||||
var extend = require('util')._extend;
|
||||
var stringUtils = require('underscore.string');
|
||||
|
||||
/**
|
||||
* The base class for **all models**.
|
||||
|
|
Loading…
Reference in New Issue