From a0b2869cdda930e2b9b3b800ddf6eacab7800c99 Mon Sep 17 00:00:00 2001 From: wkj <278599135@.com> Date: Thu, 27 Jun 2024 14:14:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=BD=E4=BB=A4'--resetCac?= =?UTF-8?q?he'=20=E5=AE=9E=E7=8E=B0=20'react=20native=20start=20--reset-ca?= =?UTF-8?q?che'=20=E6=B8=85=E9=99=A4=E7=BC=96=E8=AF=91=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/build.js | 1 + lib/create.js | 2 +- lib/index.js | 1 + src/build.ts | 1 + src/index.ts | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/build.js b/lib/build.js index 5ea5349..4db4245 100644 --- a/lib/build.js +++ b/lib/build.js @@ -132,6 +132,7 @@ async function build(cmd) { `OAK_DEV_MODE=${devMode}`, 'react-native', 'start', + cmd.resetCache && '--reset-cache', ].filter(Boolean), { cwd, stdio: 'inherit', diff --git a/lib/create.js b/lib/create.js index ee1727c..1c0ef12 100644 --- a/lib/create.js +++ b/lib/create.js @@ -231,7 +231,7 @@ async function create(dirName, cmd) { } // 获取package.json内容 const packageJson = (0, template_1.packageJsonContent)({ - name: DEFAULT_PROJECT_NAME, + name: DEFAULT_PROJECT_NAME, // 后面再统一rename version, description, cliName: config_1.CLI_NAME, diff --git a/lib/index.js b/lib/index.js index 6a3c91f..fa9c179 100755 --- a/lib/index.js +++ b/lib/index.js @@ -67,6 +67,7 @@ commander_1.default .option('-d, --subDir ', 'subDirName') .option('-p, --port ', 'port') .option('-dm, --devMode ', 'devMode') + .option('--resetCache', 'react native start --reset-cache') .description('build project of start on demand') .action(build_1.default); commander_1.default diff --git a/src/build.ts b/src/build.ts index f85e8b9..22e8028 100644 --- a/src/build.ts +++ b/src/build.ts @@ -169,6 +169,7 @@ export default async function build(cmd: any) { `OAK_DEV_MODE=${devMode}`, 'react-native', 'start', + cmd.resetCache && '--reset-cache', ].filter(Boolean), { cwd, diff --git a/src/index.ts b/src/index.ts index 90698c6..4774398 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,6 +76,7 @@ program .option('-d, --subDir ', 'subDirName') .option('-p, --port ', 'port') .option('-dm, --devMode ', 'devMode') + .option('--resetCache', 'react native start --reset-cache') .description('build project of start on demand') .action(build); program