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:
committed by
Dan Flettre
parent
0de80165ed
commit
5158606740
@@ -29,7 +29,6 @@
|
|||||||
"iso-639-1": "^1.2.1",
|
"iso-639-1": "^1.2.1",
|
||||||
"languagedetect": "^1.1.1",
|
"languagedetect": "^1.1.1",
|
||||||
"location-history": "^1.0.0",
|
"location-history": "^1.0.0",
|
||||||
"lodash.merge": "^4.6.0",
|
|
||||||
"material-ui": "^0.16.0",
|
"material-ui": "^0.16.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"musicmetadata": "^2.0.2",
|
"musicmetadata": "^2.0.2",
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Perf optimization: Hook into require() to modify how certain modules load:
|
* 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
|
* - `inline-style-prefixer` (used by `material-ui`) takes ~40ms. It is not
|
||||||
* actually used because auto-prefixing is disabled with
|
* actually used because auto-prefixing is disabled with
|
||||||
* `darkBaseTheme.userAgent = false`. Return a fake object.
|
* `darkBaseTheme.userAgent = false`. Return a fake object.
|
||||||
@@ -12,7 +8,6 @@
|
|||||||
let Module = require('module')
|
let Module = require('module')
|
||||||
const _require = Module.prototype.require
|
const _require = Module.prototype.require
|
||||||
Module.prototype.require = function (id) {
|
Module.prototype.require = function (id) {
|
||||||
if (id === 'lodash/merge') id = 'lodash.merge'
|
|
||||||
if (id === 'inline-style-prefixer') return {}
|
if (id === 'inline-style-prefixer') return {}
|
||||||
return _require.apply(this, arguments)
|
return _require.apply(this, arguments)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user