mirror of https://github.com/status-im/metro.git
Adds a (deprecated) --reset-cache option
Reviewed By: BYK Differential Revision: D6424553 fbshipit-source-id: f84064f86a985ab19794ea3d94410dceac77a95b
This commit is contained in:
parent
cf9ef1b30f
commit
9249ebcea7
|
@ -48,6 +48,9 @@ exports.builder = (yargs: Yargs) => {
|
||||||
yargs.option('legacy-bundler', {type: 'boolean'});
|
yargs.option('legacy-bundler', {type: 'boolean'});
|
||||||
|
|
||||||
yargs.option('config', {alias: 'c', type: 'string'});
|
yargs.option('config', {alias: 'c', type: 'string'});
|
||||||
|
|
||||||
|
// Deprecated
|
||||||
|
yargs.option('reset-cache', {type: 'boolean', describe: null});
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line no-unclear-flowtypes
|
// eslint-disable-next-line no-unclear-flowtypes
|
||||||
|
|
|
@ -51,6 +51,9 @@ exports.builder = (yargs: Yargs) => {
|
||||||
yargs.option('legacy-bundler', {type: 'boolean'});
|
yargs.option('legacy-bundler', {type: 'boolean'});
|
||||||
|
|
||||||
yargs.option('config', {alias: 'c', type: 'string'});
|
yargs.option('config', {alias: 'c', type: 'string'});
|
||||||
|
|
||||||
|
// Deprecated
|
||||||
|
yargs.option('reset-cache', {type: 'boolean', describe: null});
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line no-unclear-flowtypes
|
// eslint-disable-next-line no-unclear-flowtypes
|
||||||
|
|
|
@ -49,6 +49,8 @@ type PublicMetroOptions = {|
|
||||||
config?: ConfigT,
|
config?: ConfigT,
|
||||||
maxWorkers?: number,
|
maxWorkers?: number,
|
||||||
projectRoots: Array<string>,
|
projectRoots: Array<string>,
|
||||||
|
// deprecated
|
||||||
|
resetCache?: boolean,
|
||||||
|};
|
|};
|
||||||
|
|
||||||
type PrivateMetroOptions = {|
|
type PrivateMetroOptions = {|
|
||||||
|
@ -73,6 +75,7 @@ async function asyncRealpath(path): Promise<string> {
|
||||||
|
|
||||||
async function runMetro({
|
async function runMetro({
|
||||||
config,
|
config,
|
||||||
|
resetCache = false,
|
||||||
maxWorkers = 1,
|
maxWorkers = 1,
|
||||||
projectRoots = [],
|
projectRoots = [],
|
||||||
watch = false,
|
watch = false,
|
||||||
|
@ -114,7 +117,7 @@ async function runMetro({
|
||||||
postProcessModules: normalizedConfig.postProcessModules,
|
postProcessModules: normalizedConfig.postProcessModules,
|
||||||
postProcessBundleSourcemap: normalizedConfig.postProcessBundleSourcemap,
|
postProcessBundleSourcemap: normalizedConfig.postProcessBundleSourcemap,
|
||||||
providesModuleNodeModules,
|
providesModuleNodeModules,
|
||||||
resetCache: false,
|
resetCache,
|
||||||
reporter: new TerminalReporter(new Terminal(process.stdout)),
|
reporter: new TerminalReporter(new Terminal(process.stdout)),
|
||||||
sourceExts: normalizedConfig.assetTransforms
|
sourceExts: normalizedConfig.assetTransforms
|
||||||
? sourceExts.concat(assetExts)
|
? sourceExts.concat(assetExts)
|
||||||
|
@ -146,6 +149,7 @@ exports.createConnectMiddleware = async function(
|
||||||
config: options.config,
|
config: options.config,
|
||||||
maxWorkers: options.maxWorkers,
|
maxWorkers: options.maxWorkers,
|
||||||
projectRoots: options.projectRoots,
|
projectRoots: options.projectRoots,
|
||||||
|
resetCache: options.resetCache,
|
||||||
watch: true,
|
watch: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -176,6 +180,7 @@ exports.runServer = async (options: RunServerOptions) => {
|
||||||
config: options.config,
|
config: options.config,
|
||||||
maxWorkers: options.maxWorkers,
|
maxWorkers: options.maxWorkers,
|
||||||
projectRoots: options.projectRoots,
|
projectRoots: options.projectRoots,
|
||||||
|
resetCache: options.resetCache,
|
||||||
});
|
});
|
||||||
|
|
||||||
serverApp.use(middleware);
|
serverApp.use(middleware);
|
||||||
|
@ -230,6 +235,7 @@ exports.runBuild = async (options: RunBuildOptions) => {
|
||||||
config: options.config,
|
config: options.config,
|
||||||
maxWorkers: options.maxWorkers,
|
maxWorkers: options.maxWorkers,
|
||||||
projectRoots: options.projectRoots,
|
projectRoots: options.projectRoots,
|
||||||
|
resetCache: options.resetCache,
|
||||||
});
|
});
|
||||||
|
|
||||||
const requestOptions: RequestOptions = {
|
const requestOptions: RequestOptions = {
|
||||||
|
|
Loading…
Reference in New Issue