diff --git a/packages/core/src/tasks/taskFinder.ts b/packages/core/src/tasks/taskFinder.ts index be960b341..2b580f7ac 100644 --- a/packages/core/src/tasks/taskFinder.ts +++ b/packages/core/src/tasks/taskFinder.ts @@ -47,8 +47,7 @@ export const extractSingleExecutableTask = async ( suitableTasks: RnvTask[], taskName: string ): Promise => { - const { platform } = getContext(); - if (suitableTasks.length === 1 && platform) { + if (suitableTasks.length === 1) { return suitableTasks[0]; } else if (suitableTasks.length === 0) { return undefined; diff --git a/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts b/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts index 33d452ee5..4ce89d8af 100644 --- a/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts +++ b/packages/engine-core/src/tasks/platform/taskPlatformConfigure.ts @@ -26,13 +26,13 @@ export default createTask({ isPrivate: true, dependsOn: [RnvTaskName.projectConfigure], fn: async ({ ctx, taskName, originTaskName }) => { - const { program } = ctx; + const { program, platform } = ctx; await isBuildSchemeSupported(); const entryFile = getConfigProp('entryFile'); const dest = path.join(ctx.paths.project.dir, `${entryFile}.js`); - if (!fsExistsSync(dest)) { + if (!fsExistsSync(dest) && platform) { if (!entryFile) { logWarning( `Missing ${chalk().red(entryFile)} key for ${chalk().bold.white(