mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +00:00
Don't use sync functions
This commit is contained in:
parent
a8776de913
commit
d5230accaf
@ -9,6 +9,7 @@ const { resolve, join, dirname } = require('path')
|
||||
const copy = pify(fs.copy)
|
||||
const remove = pify(fs.remove)
|
||||
const writeFile = pify(fs.writeFile)
|
||||
const mkdirp = pify(fs.mkdirp)
|
||||
|
||||
const defaults = {
|
||||
dir: 'dist',
|
||||
@ -53,8 +54,10 @@ module.exports = function () {
|
||||
debug('Generate file: ' + path)
|
||||
path = join(distPath, path)
|
||||
// Make sure the sub folders are created
|
||||
fs.mkdirsSync(dirname(path))
|
||||
return writeFile(path, html, 'utf8')
|
||||
return co(function * () {
|
||||
yield mkdirp(dirname(path))
|
||||
yield writeFile(path, html, 'utf8')
|
||||
})
|
||||
})
|
||||
promises.push(promise)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user