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,
|
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
|
* 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
|
* files. If false, only the .babelrc file (if one exists) in the main project
|
||||||
|
@ -175,6 +181,7 @@ const DEFAULT = ({
|
||||||
cacheStores: [],
|
cacheStores: [],
|
||||||
cacheVersion: '1.0',
|
cacheVersion: '1.0',
|
||||||
dynamicDepsInPackages: 'throwAtRuntime',
|
dynamicDepsInPackages: 'throwAtRuntime',
|
||||||
|
getAsyncRequireModulePath: () => 'metro/src/lib/bundle-modules/asyncRequire',
|
||||||
getAssetExts: () => [],
|
getAssetExts: () => [],
|
||||||
getBlacklistRE: () => blacklist(),
|
getBlacklistRE: () => blacklist(),
|
||||||
getEnableBabelRCLookup: () => true,
|
getEnableBabelRCLookup: () => true,
|
||||||
|
|
|
@ -110,6 +110,7 @@ async function runMetro({
|
||||||
projectRoots: finalProjectRoots,
|
projectRoots: finalProjectRoots,
|
||||||
});
|
});
|
||||||
const serverOptions: ServerOptions = {
|
const serverOptions: ServerOptions = {
|
||||||
|
asyncRequireModulePath: normalizedConfig.getAsyncRequireModulePath(),
|
||||||
assetExts: normalizedConfig.assetTransforms ? [] : assetExts,
|
assetExts: normalizedConfig.assetTransforms ? [] : assetExts,
|
||||||
assetRegistryPath: normalizedConfig.assetRegistryPath,
|
assetRegistryPath: normalizedConfig.assetRegistryPath,
|
||||||
blacklistRE: normalizedConfig.getBlacklistRE(),
|
blacklistRE: normalizedConfig.getBlacklistRE(),
|
||||||
|
|
|
@ -78,7 +78,7 @@ export type Options = {|
|
||||||
// TODO: Remove this option below (T23793920)
|
// TODO: Remove this option below (T23793920)
|
||||||
assetTransforms?: boolean,
|
assetTransforms?: boolean,
|
||||||
assetExts?: Array<string>,
|
assetExts?: Array<string>,
|
||||||
+asyncRequireModulePath?: string,
|
+asyncRequireModulePath: string,
|
||||||
+assetRegistryPath: string,
|
+assetRegistryPath: string,
|
||||||
blacklistRE?: RegExp,
|
blacklistRE?: RegExp,
|
||||||
cacheStores: $ReadOnlyArray<CacheStore<TransformedCode>>,
|
cacheStores: $ReadOnlyArray<CacheStore<TransformedCode>>,
|
||||||
|
|
Loading…
Reference in New Issue