Skip to content

Commit

Permalink
fix(cli): 修复h5模式偶发找不到模块的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Littly committed Jul 18, 2018
1 parent a605eec commit c2e2184
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/taro-cli/src/h5.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,12 +454,10 @@ function classifyFiles (filename) {
}
function getDist (filename) {
const dirname = path.dirname(filename)
const extname = path.extname(filename)
const distDirname = dirname.replace(sourceDir, tempDir)
const distPath = path.format({
dir: distDirname,
name: path.basename(filename, extname),
ext: extname
base: path.basename(filename)
})
return distPath
}
Expand All @@ -485,8 +483,7 @@ function processFiles (filePath) {
} else {
// 其他 直接复制
fs.ensureDirSync(distDirname)
fs.createReadStream(filePath)
.pipe(fs.createWriteStream(distPath))
fs.copyFileSync(filePath, distPath)
}
} catch (e) {
console.log(e)
Expand Down

0 comments on commit c2e2184

Please sign in to comment.