增加命令'--resetCache' 实现 'react native start --reset-cache'

清除编译缓存
This commit is contained in:
wkj 2024-06-27 14:14:11 +08:00
parent f076a0422f
commit a0b2869cdd
5 changed files with 5 additions and 1 deletions

View File

@ -132,6 +132,7 @@ async function build(cmd) {
`OAK_DEV_MODE=${devMode}`,
'react-native',
'start',
cmd.resetCache && '--reset-cache',
].filter(Boolean), {
cwd,
stdio: 'inherit',

View File

@ -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,

View File

@ -67,6 +67,7 @@ commander_1.default
.option('-d, --subDir <subDirName>', 'subDirName')
.option('-p, --port <port>', 'port')
.option('-dm, --devMode <devMode>', 'devMode')
.option('--resetCache', 'react native start --reset-cache')
.description('build project of start on demand')
.action(build_1.default);
commander_1.default

View File

@ -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,

View File

@ -76,6 +76,7 @@ program
.option('-d, --subDir <subDirName>', 'subDirName')
.option('-p, --port <port>', 'port')
.option('-dm, --devMode <devMode>', 'devMode')
.option('--resetCache', 'react native start --reset-cache')
.description('build project of start on demand')
.action(build);
program