From 79e647e8533080098939c5c475479e191f373bbe Mon Sep 17 00:00:00 2001 From: luckyadam Date: Sat, 12 Oct 2019 17:13:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(cli):=20taro=20convert=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=84=E7=90=86=20app.json=20=E4=B8=AD=20sitemapLocation=20?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=EF=BC=8Cclose=20#4534?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/src/convertor/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/taro-cli/src/convertor/index.ts b/packages/taro-cli/src/convertor/index.ts index 150d8dcf07d3..0f55b6c1d1dc 100644 --- a/packages/taro-cli/src/convertor/index.ts +++ b/packages/taro-cli/src/convertor/index.ts @@ -112,6 +112,7 @@ export default class Convertor { this.initConvert() this.getApp() this.getPages() + this.getSitemapLocation() this.getSubPackages() } @@ -377,6 +378,17 @@ export default class Convertor { }) } + getSitemapLocation () { + const sitemapLocation = this.entryJSON['sitemapLocation'] + if (sitemapLocation) { + const sitemapFilePath = path.join(this.root, sitemapLocation) + if (fs.existsSync(sitemapFilePath)) { + const outputFilePath = path.join(this.convertRoot, sitemapLocation) + this.copyFileToTaro(sitemapFilePath, outputFilePath) + } + } + } + generateScriptFiles (files: Set) { if (!files) { return @@ -514,7 +526,7 @@ export default class Convertor { const pageUsingComponnets = pageConfig.usingComponents if (pageUsingComponnets) { // 页面依赖组件 - let usingComponents = {} + const usingComponents = {} Object.keys(pageUsingComponnets).forEach(component => { let componentPath = path.resolve(pageConfigPath, '..', pageUsingComponnets[component]) if (!fs.existsSync(resolveScriptPath(componentPath))) {