From 558798e433e423a3af008a64b451801663a2a8d3 Mon Sep 17 00:00:00 2001 From: Patrick Lu Date: Sat, 29 Nov 2025 11:44:30 -0800 Subject: [PATCH] fix: Remove debug logging from webpack plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes excessive console.log statements that clutter user build output: - Plugin initialization and options logging - Server/dev mode skip messages - Production mode entry message - TypeScript config path resolution logging - Alias detection and mapping logs These debug messages are unnecessary for end users and make build output noisy. Keeping console.warn statements for actual warnings that users should see (e.g., tsconfig parsing errors, missing main bundle). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/webpack-plugin.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/webpack-plugin.ts b/src/webpack-plugin.ts index f445b36..7fff957 100644 --- a/src/webpack-plugin.ts +++ b/src/webpack-plugin.ts @@ -113,7 +113,6 @@ export default class CodePressWebpackPlugin { if (!aliases.has("@")) { const tsconfigPath = path.join(compiler.context, "tsconfig.json"); - console.log("[CodePress] Looking for @ alias in tsconfig:", tsconfigPath); try { if (fs.existsSync(tsconfigPath)) { @@ -127,7 +126,6 @@ export default class CodePressWebpackPlugin { if (pathsMatch) { const pathsContent = pathsMatch[1]; - console.log("[CodePress] Found paths block:", pathsContent.trim()); // Extract individual path mappings: "@/*": ["./src/*"] const pathPattern = /"([^"]+)"\s*:\s*\[\s*"([^"]+)"/g; @@ -143,15 +141,7 @@ export default class CodePressWebpackPlugin { .replace(/\/\*$/, ""); aliases.set(alias, targetPath); - console.log( - "[CodePress] Added alias from tsconfig:", - alias, - "->", - targetPath - ); } - } else { - console.log("[CodePress] No paths block found in tsconfig"); } } } catch (e) { @@ -163,7 +153,6 @@ export default class CodePressWebpackPlugin { const srcDir = path.join(compiler.context, "src"); if (fs.existsSync(srcDir)) { aliases.set("@", "src"); - console.log("[CodePress] Using default Next.js alias: @ → src"); } } } @@ -196,26 +185,17 @@ export default class CodePressWebpackPlugin { * Apply the plugin to the webpack compiler */ public apply(compiler: Compiler): void { - console.log("[CodePress] Plugin apply() called with options:", { - isServer: this.options.isServer, - dev: this.options.dev, - }); - // Skip server builds entirely if (this.options.isServer) { - console.log("[CodePress] Skipping: isServer=true"); return; } // Skip dev mode - module mapping not needed (dev has named IDs) // and env vars are handled by the SWC plugin if (this.options.dev) { - console.log("[CodePress] Skipping: dev=true"); return; } - console.log("[CodePress] Running in production mode, will build MODULE_MAP"); - // Disable optimizations that break CodePress preview in production builds. // This is REQUIRED for CodePress preview to work because: //