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 e5736e5..535e514 100644 --- a/lib/create.js +++ b/lib/create.js @@ -232,7 +232,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