Skip to content

Commit d20ee9c

Browse files
committed
Remove unecessary check on Webpack version 4
1 parent 1a2e5ef commit d20ee9c

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/webpack-manifest-plugin/index.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
const { relative, resolve } = require('path');
1010

11-
const webpack = require('webpack');
1211
const NormalModule = require('webpack/lib/NormalModule');
1312

1413
const { beforeRunHook, emitHook, getCompilerHooks, normalModuleLoaderHook } = require('./hooks');
@@ -65,13 +64,9 @@ class WebpackManifestPlugin {
6564
hook.tap(hookOptions, normalModuleLoader);
6665
});
6766

68-
if (webpack.version.startsWith('4')) {
69-
compiler.hooks.emit.tap(hookOptions, emit);
70-
} else {
71-
compiler.hooks.thisCompilation.tap(hookOptions, (compilation) => {
72-
compilation.hooks.processAssets.tap(hookOptions, () => emit(compilation));
73-
});
74-
}
67+
compiler.hooks.thisCompilation.tap(hookOptions, (compilation) => {
68+
compilation.hooks.processAssets.tap(hookOptions, () => emit(compilation));
69+
});
7570

7671
compiler.hooks.run.tap(hookOptions, beforeRun);
7772
compiler.hooks.watchRun.tap(hookOptions, beforeRun);

0 commit comments

Comments
 (0)