require.js: Delete dependency map after factory ran

Summary: Releases the dependency map of modules after running the factory in release mode in order to save memory.

Reviewed By: cpojer

Differential Revision: D5086693

fbshipit-source-id: 68c57a2f98182ed1a732e1336e6d4fe5ce27abc3
This commit is contained in:
David Aurelio 2017-05-19 03:21:24 -07:00 committed by Facebook Github Bot
parent b1eb0bbee5
commit 516367f971
1 changed files with 1 additions and 0 deletions

View File

@ -177,6 +177,7 @@ function loadModuleImplementation(moduleId, module) {
if (!__DEV__) { if (!__DEV__) {
// $FlowFixMe: This is only sound because we never access `factory` again // $FlowFixMe: This is only sound because we never access `factory` again
module.factory = undefined; module.factory = undefined;
module.dependencyMap = undefined;
} }
if (__DEV__) { if (__DEV__) {