Skip to content

Commit

Permalink
Update comments to indicate it works with webpack 4 and 5
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Aug 31, 2021
1 parent bb7cd85 commit 027135e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -222,7 +222,7 @@ module.exports = function (options, wp, done) {
const fs = compiler.outputFileSystem = cache.mfs;

const assetEmittedPlugin = compiler.hooks
// Webpack 4
// Webpack 4/5
? function (callback) { compiler.hooks.assetEmitted.tapAsync('WebpackStream', callback); }
// Webpack 2/3
: function (callback) { compiler.plugin('asset-emitted', callback); };
Expand All @@ -244,7 +244,7 @@ module.exports = function (options, wp, done) {

if (options.watch && !isSilent) {
const watchRunPlugin = compiler.hooks
// Webpack 4
// Webpack 4/5
? callback => compiler.hooks.watchRun.tapAsync('WebpackInfo', callback)
// Webpack 2/3
: callback => compiler.plugin('watch-run', callback);
Expand Down

0 comments on commit 027135e

Please sign in to comment.