mirror of
https://github.com/status-im/react-native.git
synced 2025-01-21 23:09:22 +00:00
b62ed2f291
Summary: Adds the possibility to specify an array of files (group roots) that are used to bundle modules outside of the “startup section” into bigger groups by colocating their code. A require call for any grouped module will load all modules in that group. Files contained by multiple groups are deoptimized (i.e. bundled as individual script) Reviewed By: martinbigio Differential Revision: D3841780 fbshipit-source-id: 8d37782792efd66b5f557c7567489f68c9b229d8
24 lines
713 B
JavaScript
24 lines
713 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
const {combineSourceMaps, joinModules} = require('./util');
|
|
|
|
module.exports = ({startupModules, lazyModules, moduleGroups}) => {
|
|
const startupModule = {
|
|
code: joinModules(startupModules),
|
|
map: combineSourceMaps({modules: startupModules}),
|
|
};
|
|
return combineSourceMaps({
|
|
modules: [startupModule].concat(lazyModules),
|
|
moduleGroups,
|
|
withCustomOffsets: true,
|
|
});
|
|
};
|