Skip to content

Commit

Permalink
fix(cli): taro convert 支持处理 app.json 中 sitemapLocation 属性,close #4534
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Oct 12, 2019
1 parent 425d7b6 commit 79e647e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/taro-cli/src/convertor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export default class Convertor {
this.initConvert()
this.getApp()
this.getPages()
this.getSitemapLocation()
this.getSubPackages()
}

Expand Down Expand Up @@ -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<string>) {
if (!files) {
return
Expand Down Expand Up @@ -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))) {
Expand Down

0 comments on commit 79e647e

Please sign in to comment.