diff --git a/compiler/main.js b/compiler/main.js index c506188..ea017ba 100644 --- a/compiler/main.js +++ b/compiler/main.js @@ -382,32 +382,32 @@ function loadModuleInfo(projectConfig, envArgs) { function checkAppResourcePath(appResourcePath, config) { if (appResourcePath) { - const appResourcePathSavePath = path.resolve(projectConfig.cachePath, 'resource_path.txt'); - saveAppResourcePath(appResourcePath, appResourcePathSavePath); readAppResource(resources, appResourcePath); if (fs.existsSync(appResourcePath) && config.cache) { config.cache.buildDependencies.config.push(appResourcePath); } - if (fs.existsSync(appResourcePathSavePath) && config.cache) { - config.cache.buildDependencies.config.push(appResourcePathSavePath); + if (!projectConfig.xtsMode) { + const appResourcePathSavePath = path.resolve(projectConfig.cachePath, 'resource_path.txt'); + saveAppResourcePath(appResourcePath, appResourcePathSavePath); + if (fs.existsSync(appResourcePathSavePath) && config.cache) { + config.cache.buildDependencies.config.push(appResourcePathSavePath); + } } } } function saveAppResourcePath(appResourcePath, appResourcePathSavePath) { - if (!projectConfig.xtsMode) { - let isSave = false; - if (fs.existsSync(appResourcePathSavePath)) { - const saveContent = fs.readFileSync(appResourcePathSavePath); - if (appResourcePath !== saveContent) { - isSave = true; - } - } else { + let isSave = false; + if (fs.existsSync(appResourcePathSavePath)) { + const saveContent = fs.readFileSync(appResourcePathSavePath); + if (appResourcePath !== saveContent) { isSave = true; } - if (isSave) { - fs.writeFileSync(appResourcePathSavePath, appResourcePath); - } + } else { + isSave = true; + } + if (isSave) { + fs.writeFileSync(appResourcePathSavePath, appResourcePath); } }