From 3d2a7b29d1f4d4b7eec352ac1955fbf5bb640d9f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 1 Jun 2018 16:54:37 +0430 Subject: [PATCH] use pify instead of utils.promisify for legacy build support --- lib/builder/builder.js | 10 +++++----- package.json | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/builder/builder.js b/lib/builder/builder.js index bc14777189..a0f99ccfa5 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -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( diff --git a/package.json b/package.json index 4ada45afd6..128d58243e 100644 --- a/package.json +++ b/package.json @@ -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",