From 51586067406b90be875b83127e12415df32199eb Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 10 Oct 2016 23:35:33 -0700 Subject: [PATCH] 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. --- package.json | 1 - src/renderer/main.js | 5 ----- 2 files changed, 6 deletions(-) diff --git a/package.json b/package.json index 58d55c13..edfc285c 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/renderer/main.js b/src/renderer/main.js index a48344b5..26611d5c 100644 --- a/src/renderer/main.js +++ b/src/renderer/main.js @@ -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) }