diff --git a/lib/webpack-manifest-plugin/index.js b/lib/webpack-manifest-plugin/index.js index 4521a3e9..ba80f990 100644 --- a/lib/webpack-manifest-plugin/index.js +++ b/lib/webpack-manifest-plugin/index.js @@ -8,7 +8,6 @@ */ const { relative, resolve } = require('path'); -const webpack = require('webpack'); const NormalModule = require('webpack/lib/NormalModule'); const { beforeRunHook, emitHook, getCompilerHooks, normalModuleLoaderHook } = require('./hooks'); @@ -65,13 +64,9 @@ class WebpackManifestPlugin { hook.tap(hookOptions, normalModuleLoader); }); - if (webpack.version.startsWith('4')) { - compiler.hooks.emit.tap(hookOptions, emit); - } else { - compiler.hooks.thisCompilation.tap(hookOptions, (compilation) => { - compilation.hooks.processAssets.tap(hookOptions, () => emit(compilation)); - }); - } + compiler.hooks.thisCompilation.tap(hookOptions, (compilation) => { + compilation.hooks.processAssets.tap(hookOptions, () => emit(compilation)); + }); compiler.hooks.run.tap(hookOptions, beforeRun); compiler.hooks.watchRun.tap(hookOptions, beforeRun);