diff --git a/packages/uni-cli-shared/src/json/pages.ts b/packages/uni-cli-shared/src/json/pages.ts index 96ae149e17cfc8ebebcf2896d05d5b5e2d146244..434d07a1555dfa490848a77f91b97f7cdc53cd0d 100644 --- a/packages/uni-cli-shared/src/json/pages.ts +++ b/packages/uni-cli-shared/src/json/pages.ts @@ -197,14 +197,29 @@ function normalizePageStyle( pageStyle: UniApp.PagesJsonPageStyle | undefined, platform: UniApp.PLATFORM ) { - const isNVue = + const hasNVue = pagePath && process.env.UNI_INPUT_DIR && - process.env.UNI_NVUE_COMPILER !== 'vue' && fs.existsSync(path.join(process.env.UNI_INPUT_DIR, pagePath + '.nvue')) ? true : undefined + let isNVue = false + if (hasNVue) { + const hasVue = fs.existsSync( + path.join(process.env.UNI_INPUT_DIR, pagePath + '.vue') + ) + if (hasVue) { + if (platform === 'app') { + if (process.env.UNI_NVUE_COMPILER !== 'vue') { + isNVue = true + } + } + } else { + isNVue = true + } + } + if (pageStyle) { if (platform === 'h5') { extend(pageStyle, pageStyle['app'] || pageStyle['app-plus'])