use pify instead of utils.promisify for legacy build support

This commit is contained in:
Pooya Parsa 2018-06-01 16:54:37 +04:30
parent 727ef16920
commit 3d2a7b29d1
2 changed files with 6 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import util from 'util'
import path from 'path'
import fs from 'fs'
import pify from 'pify'
import _ from 'lodash'
import chokidar from 'chokidar'
import fsExtra from 'fs-extra'
@ -22,7 +22,7 @@ import PerfLoader from './webpack/utils/perf-loader'
import ClientWebpackConfig from './webpack/client'
import ServerWebpackConfig from './webpack/server'
const glob = util.promisify(Glob)
const glob = pify(Glob)
export default class Builder {
constructor(nuxt) {
@ -539,7 +539,7 @@ export default class Builder {
consola.debug('Adding webpack middleware...')
// Create webpack dev middleware
this.webpackDevMiddleware = util.promisify(
this.webpackDevMiddleware = pify(
webpackDevMiddleware(
compiler,
Object.assign(
@ -554,9 +554,9 @@ export default class Builder {
)
)
this.webpackDevMiddleware.close = util.promisify(this.webpackDevMiddleware.close)
this.webpackDevMiddleware.close = pify(this.webpackDevMiddleware.close)
this.webpackHotMiddleware = util.promisify(
this.webpackHotMiddleware = pify(
webpackHotMiddleware(
compiler,
Object.assign(

View File

@ -99,6 +99,7 @@
"mini-css-extract-plugin": "^0.4.0",
"minimist": "^1.2.0",
"opencollective": "^1.0.3",
"pify": "^3.0.0",
"postcss": "^6.0.22",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^11.1.0",