mirror of https://github.com/status-im/metro.git
Expose the asyncRequireModulePath param
Reviewed By: mjesun Differential Revision: D7709569 fbshipit-source-id: 871dd9c178b1e5c81163558201ef983315561211
This commit is contained in:
parent
87e3ce281a
commit
e11dddd141
|
@ -67,6 +67,12 @@ export type ConfigT = {
|
|||
*/
|
||||
getBlacklistRE(): RegExp,
|
||||
|
||||
/**
|
||||
* Specify an implementation module to load async import modules (for
|
||||
* splitting).
|
||||
*/
|
||||
getAsyncRequireModulePath(): string,
|
||||
|
||||
/**
|
||||
* Specify whether or not to enable Babel's behavior for looking up .babelrc
|
||||
* files. If false, only the .babelrc file (if one exists) in the main project
|
||||
|
@ -175,6 +181,7 @@ const DEFAULT = ({
|
|||
cacheStores: [],
|
||||
cacheVersion: '1.0',
|
||||
dynamicDepsInPackages: 'throwAtRuntime',
|
||||
getAsyncRequireModulePath: () => 'metro/src/lib/bundle-modules/asyncRequire',
|
||||
getAssetExts: () => [],
|
||||
getBlacklistRE: () => blacklist(),
|
||||
getEnableBabelRCLookup: () => true,
|
||||
|
|
|
@ -110,6 +110,7 @@ async function runMetro({
|
|||
projectRoots: finalProjectRoots,
|
||||
});
|
||||
const serverOptions: ServerOptions = {
|
||||
asyncRequireModulePath: normalizedConfig.getAsyncRequireModulePath(),
|
||||
assetExts: normalizedConfig.assetTransforms ? [] : assetExts,
|
||||
assetRegistryPath: normalizedConfig.assetRegistryPath,
|
||||
blacklistRE: normalizedConfig.getBlacklistRE(),
|
||||
|
|
|
@ -78,7 +78,7 @@ export type Options = {|
|
|||
// TODO: Remove this option below (T23793920)
|
||||
assetTransforms?: boolean,
|
||||
assetExts?: Array<string>,
|
||||
+asyncRequireModulePath?: string,
|
||||
+asyncRequireModulePath: string,
|
||||
+assetRegistryPath: string,
|
||||
blacklistRE?: RegExp,
|
||||
cacheStores: $ReadOnlyArray<CacheStore<TransformedCode>>,
|
||||
|
|
Loading…
Reference in New Issue