Remove lodash.merge require() hack

See:
https://github.com/callemall/material-ui/pull/4380#issuecomment-25089455
2

My PR to material-ui to replace the full `lodash` with just the needed
functions was merged. So we can remove this hack.
This commit is contained in:
Feross Aboukhadijeh
2016-10-10 23:35:33 -07:00
committed by Dan Flettre
parent 0de80165ed
commit 5158606740
2 changed files with 0 additions and 6 deletions

View File

@@ -29,7 +29,6 @@
"iso-639-1": "^1.2.1",
"languagedetect": "^1.1.1",
"location-history": "^1.0.0",
"lodash.merge": "^4.6.0",
"material-ui": "^0.16.0",
"mkdirp": "^0.5.1",
"musicmetadata": "^2.0.2",

View File

@@ -1,10 +1,6 @@
/**
* Perf optimization: Hook into require() to modify how certain modules load:
*
* - `lodash/merge` (used by `material-ui`) causes 119 require() calls at startup,
* which take ~100ms. Replace it with `lodash.merge` which is equivalent.
* See: https://github.com/callemall/material-ui/pull/4380#issuecomment-250894552
*
* - `inline-style-prefixer` (used by `material-ui`) takes ~40ms. It is not
* actually used because auto-prefixing is disabled with
* `darkBaseTheme.userAgent = false`. Return a fake object.
@@ -12,7 +8,6 @@
let Module = require('module')
const _require = Module.prototype.require
Module.prototype.require = function (id) {
if (id === 'lodash/merge') id = 'lodash.merge'
if (id === 'inline-style-prefixer') return {}
return _require.apply(this, arguments)
}