Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
debug-require-webpack-plugin: Remove enhanced-resolve references.
Anders Kaseorg5572a86f15a1
diff --git a/package.json b/package.jsonindex be57d20d056..b9e3aa10373 100644--- a/package.json+++ b/package.json@@ -140,7 +140,6 @@"css.escape": "^1.5.1","diff": "^8.0.2","difflib": "^0.2.4",- "enhanced-resolve": "^5.8.2","es-check": "^9.1.2","eslint": "^9.15.0","eslint-config-prettier": "^10.0.1",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex d65135df1ab..bc654fa708f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -448,9 +448,6 @@ importers:difflib:specifier: ^0.2.4version: 0.2.4- enhanced-resolve:- specifier: ^5.8.2- version: 5.20.0es-check:specifier: ^9.1.2version: 9.6.2diff --git a/web/debug-require-webpack-plugin.ts b/web/debug-require-webpack-plugin.tsindex 5bf154fcb23..3da5d873c97 100644--- a/web/debug-require-webpack-plugin.ts+++ b/web/debug-require-webpack-plugin.ts@@ -4,14 +4,13 @@import path from "node:path";-import type {ResolveRequest} from "enhanced-resolve";import webpack from "webpack";export default class DebugRequirePlugin implements webpack.WebpackPluginInstance {apply(compiler: webpack.Compiler): void {const resolved = new Map<string, Set<string>>();const nameSymbol = Symbol("DebugRequirePluginName");- type NamedRequest = ResolveRequest & {+ type NamedRequest = {[nameSymbol]?: string | undefined;};let debugRequirePath: string | false = false;@@ -38,21 +37,19 @@ export default class DebugRequirePlugin implements webpack.WebpackPluginInstancereturn undefined!;});- resolver- .getHook("beforeResolved")- .tap("DebugRequirePlugin", (req: ResolveRequest) => {- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions- const name = (req as NamedRequest)[nameSymbol];- if (name !== undefined && req.path !== false) {- const names = resolved.get(req.path);- if (names) {- names.add(name);- } else {- resolved.set(req.path, new Set([name]));- }+ resolver.getHook("beforeResolved").tap("DebugRequirePlugin", (req) => {+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions+ const name = (req as NamedRequest)[nameSymbol];+ if (name !== undefined && req.path !== false) {+ const names = resolved.get(req.path);+ if (names) {+ names.add(name);+ } else {+ resolved.set(req.path, new Set([name]));}- return undefined!;- });+ }+ return undefined!;+ });});compiler.hooks.beforeCompile.tapPromise(