Skip to content

Commit

Permalink
fix(cli): 兼容没有 project.config.json 的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jun 25, 2018
1 parent 3c73c69 commit a9c2b8b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/taro-cli/src/weapp.js
Expand Up @@ -539,7 +539,11 @@ async function compileScriptFile (filePath, content) {
}

function buildProjectConfig () {
const origProjectConfig = fs.readJsonSync(path.join(appPath, 'project.config.json'))
const projectConfigPath = path.join(appPath, 'project.config.json')
if (!fs.existsSync(projectConfigPath)) {
return
}
const origProjectConfig = fs.readJSONSync(projectConfigPath)
fs.writeFileSync(
path.join(outputDir, 'project.config.json'),
JSON.stringify(Object.assign({}, origProjectConfig, { miniprogramRoot: './' }), null, 2)
Expand Down

0 comments on commit a9c2b8b

Please sign in to comment.