mirror of https://github.com/status-im/metro.git
Pass runBeforeMainModule option correctly when building prod bundles
Summary: On D6248242, runBeforeMainModule was changed to `getModulesRunBeforeMainModule`, but the entry point used by opensource to build prod bundles was not updated. We couldn't catch this since we don't use this codepath internally Fixes https://github.com/facebook/metro/issues/73 Reviewed By: mjesun Differential Revision: D6556097 fbshipit-source-id: 889eaf825c7c3cdebe1ca4fc9831020a4a7d56dc
This commit is contained in:
parent
26159b6638
commit
db47372f06
|
@ -439,7 +439,7 @@ describe('processRequest', () => {
|
|||
onProgress: null,
|
||||
platform: undefined,
|
||||
resolutionResponse: null,
|
||||
runBeforeMainModule: [],
|
||||
runBeforeMainModule: ['InitializeCore'],
|
||||
runModule: true,
|
||||
sourceMapUrl: null,
|
||||
unbundle: false,
|
||||
|
|
|
@ -213,6 +213,9 @@ class Server {
|
|||
options = {
|
||||
...options,
|
||||
deltaBundleId: null,
|
||||
runBeforeMainModule: this._opts.getModulesRunBeforeMainModule(
|
||||
options.entryFile,
|
||||
),
|
||||
};
|
||||
|
||||
const fullBundle = await Serializers.fullBundle(
|
||||
|
|
|
@ -93,6 +93,7 @@ describe('basic_bundle', () => {
|
|||
const bundleWithPolyfills = await Metro.build(
|
||||
{
|
||||
assetRegistryPath: ASSET_REGISTRY_PATH,
|
||||
getModulesRunBeforeMainModule: () => ['InitializeCore'],
|
||||
getPolyfills: () => [polyfill1, polyfill2],
|
||||
projectRoots: [INPUT_PATH, POLYFILLS_PATH],
|
||||
transformCache: Metro.TransformCaching.none(),
|
||||
|
@ -112,6 +113,7 @@ describe('basic_bundle', () => {
|
|||
const bundleWithoutPolyfills = await Metro.build(
|
||||
{
|
||||
assetRegistryPath: ASSET_REGISTRY_PATH,
|
||||
getModulesRunBeforeMainModule: () => ['InitializeCore'],
|
||||
getPolyfills: () => [],
|
||||
projectRoots: [INPUT_PATH, POLYFILLS_PATH],
|
||||
transformCache: Metro.TransformCaching.none(),
|
||||
|
|
Loading…
Reference in New Issue