mirror of https://github.com/status-im/metro.git
Pass cacheVersion param via the new API
Reviewed By: BYK Differential Revision: D6980337 fbshipit-source-id: 72c01136b6720390ffec8593f0375c8756dc1d4a
This commit is contained in:
parent
afa3307659
commit
d9b6fd7102
|
@ -32,6 +32,12 @@ type Middleware = (IncomingMessage, ServerResponse, ?() => mixed) => mixed;
|
|||
export type ConfigT = {
|
||||
assetRegistryPath: string,
|
||||
|
||||
/**
|
||||
* Can be used to generate a key that will invalidate the whole metro cache
|
||||
* (for example a global dependency version used by the transformer).
|
||||
*/
|
||||
cacheVersion: string,
|
||||
|
||||
/**
|
||||
* Called with the Metro middleware in parameter; can be used to wrap this
|
||||
* middleware inside another one
|
||||
|
@ -163,6 +169,7 @@ const DEFAULT = ({
|
|||
enhanceMiddleware: middleware => middleware,
|
||||
extraNodeModules: {},
|
||||
assetTransforms: false,
|
||||
cacheVersion: '1.0',
|
||||
dynamicDepsInPackages: 'throwAtRuntime',
|
||||
getAssetExts: () => [],
|
||||
getBlacklistRE: () => blacklist(),
|
||||
|
|
|
@ -121,7 +121,7 @@ class Server {
|
|||
assetExts: options.assetTransforms ? [] : assetExts,
|
||||
assetRegistryPath: options.assetRegistryPath,
|
||||
blacklistRE: options.blacklistRE,
|
||||
cacheVersion: options.cacheVersion || '1.0',
|
||||
cacheVersion: options.cacheVersion,
|
||||
dynamicDepsInPackages: options.dynamicDepsInPackages || 'throwAtRuntime',
|
||||
createModuleIdFactory: options.createModuleIdFactory,
|
||||
enableBabelRCLookup:
|
||||
|
|
|
@ -123,6 +123,7 @@ async function runMetro({
|
|||
assetExts: normalizedConfig.assetTransforms ? [] : assetExts,
|
||||
assetRegistryPath: normalizedConfig.assetRegistryPath,
|
||||
blacklistRE: normalizedConfig.getBlacklistRE(),
|
||||
cacheVersion: normalizedConfig.cacheVersion,
|
||||
createModuleIdFactory: normalizedConfig.createModuleIdFactory,
|
||||
dynamicDepsInPackages: normalizedConfig.dynamicDepsInPackages,
|
||||
enableBabelRCLookup: normalizedConfig.getEnableBabelRCLookup(),
|
||||
|
|
|
@ -75,7 +75,7 @@ export type Options = {|
|
|||
+asyncRequireModulePath?: string,
|
||||
+assetRegistryPath: string,
|
||||
blacklistRE?: RegExp,
|
||||
cacheVersion?: string,
|
||||
cacheVersion: string,
|
||||
createModuleIdFactory?: () => (path: string) => number,
|
||||
+dynamicDepsInPackages: DynamicRequiresBehavior,
|
||||
enableBabelRCLookup: boolean,
|
||||
|
|
Loading…
Reference in New Issue