Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
fix: bind class in pify
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Feb 25, 2022
1 parent 6f693fd commit 710942f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/webpack/src/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function createDevMiddleware (compiler: Compiler) {
...nuxt.options.webpack.devMiddleware
})) as API<IncomingMessage, ServerResponse>

nuxt.hook('close', () => pify(devMiddleware.close)())
nuxt.hook('close', () => pify(devMiddleware.close.bind(devMiddleware))())

const { client: _client, ...hotMiddlewareOptions } = nuxt.options.webpack.hotMiddleware || {}
const hotMiddleware = pify(webpackHotMiddleware(compiler, {
Expand Down Expand Up @@ -146,7 +146,7 @@ async function compile (compiler: Compiler) {
}

// --- Production Build ---
const stats = await pify(compiler.run)()
const stats = await new Promise<webpack.Stats>((resolve, reject) => compiler.run((err, stats) => err ? reject(err) : resolve(stats)))

if (stats.hasErrors()) {
// non-quiet mode: errors will be printed by webpack itself
Expand Down

0 comments on commit 710942f

Please sign in to comment.