增加命令'--resetCache' 实现 'react native start --reset-cache'
清除编译缓存
This commit is contained in:
parent
f076a0422f
commit
a0b2869cdd
|
|
@ -132,6 +132,7 @@ async function build(cmd) {
|
|||
`OAK_DEV_MODE=${devMode}`,
|
||||
'react-native',
|
||||
'start',
|
||||
cmd.resetCache && '--reset-cache',
|
||||
].filter(Boolean), {
|
||||
cwd,
|
||||
stdio: 'inherit',
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue