From a51d2349ee99317cf21dc59d6d8505390edcc48d Mon Sep 17 00:00:00 2001 From: Hai Date: Mon, 15 Sep 2025 00:44:05 +0800 Subject: [PATCH] fix: lint --- .../plugins/manifest-plugin/webpack.config.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/test/configCases/plugins/manifest-plugin/webpack.config.js b/test/configCases/plugins/manifest-plugin/webpack.config.js index 906cffc67..8d2eb22ce 100644 --- a/test/configCases/plugins/manifest-plugin/webpack.config.js +++ b/test/configCases/plugins/manifest-plugin/webpack.config.js @@ -3,20 +3,25 @@ const { RawSource } = require("webpack-sources"); const webpack = require("../../../../"); +/** @typedef {import("../../../../lib/Compiler")} Compiler */ + class CopyPlugin { + /** + * Apply the plugin + * @param {Compiler} compiler the compiler instance + * @returns {void} + */ apply(compiler) { const hookOptions = { name: "MockCopyPlugin", stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS }; - const emit = (compilation, callback) => { - const output = "// some compilation result\n"; - compilation.emitAsset("third.party.js", new RawSource(output)); - callback && callback(); // eslint-disable-line no-unused-expressions - }; compiler.hooks.thisCompilation.tap(hookOptions, (compilation) => { - compilation.hooks.processAssets.tap(hookOptions, () => emit(compilation)); + compilation.hooks.processAssets.tap(hookOptions, () => { + const output = "// some compilation result\n"; + compilation.emitAsset("third.party.js", new RawSource(output)); + }); }); } }