From 3a8018b52f39dd780d243e70d742707f5a2d4a32 Mon Sep 17 00:00:00 2001 From: oasis <12181600+oasis-cloud@users.noreply.github.com> Date: Thu, 12 Sep 2024 10:04:23 +0800 Subject: [PATCH] fix: subcomponent does not exist demo.taro file, skipping this case (#2585) --- scripts/rn/copy-file.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/rn/copy-file.js b/scripts/rn/copy-file.js index 8f56891cb0..c495411490 100644 --- a/scripts/rn/copy-file.js +++ b/scripts/rn/copy-file.js @@ -76,6 +76,7 @@ const removeFile = async (url) => { } const modify = (fileUrl, importStatement) => { + if(!fse.ensureFileSync(fileUrl)) return fse.readFile(fileUrl, 'utf8').then((content) => { let modifiedContent = content modifiedContent = [importStatement, modifiedContent.slice(0)].join('')