{"_id":"@0xbigboss/vite-console-forward-plugin","_rev":"9-e9245549f21624ba93a2c55e61acca55","name":"@0xbigboss/vite-console-forward-plugin","dist-tags":{"latest":"2.3.3"},"versions":{"2.0.1":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.0.1","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.0.1","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"a70f406a5b0f94b17e3fe0a3de683db392178fe8","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.0.1.tgz","fileCount":5,"integrity":"sha512-w+3vyPJ0T9sLRnDinRmYmH4EsOmt4APeQgl+XUL9GXc1RprzB7d1lcDG4TV90t/xDK9HgLf56f1vlbYXgnoRxQ==","signatures":[{"sig":"MEUCIBf341QW/D36RrqgjurZQgF5IjylxmxrILHc8JwycJOiAiEA7ZK0jhW8z6f/o0/Ta7ERfB46xFv7fDcEc69I+PYn3Ic=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17493},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"e6358e38b3974a2f692e84bfdb91355c5100e0c2","scripts":{"dev":"vite","build":"tsc","format":"npx prettier --write .","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1"},"peerDependencies":{"vite":"^5.0.0 || ^6.0.0 || ^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.0.1_1756101656430_0.3121663004003765","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.0.2","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.0.2","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"2973517caf9b7519f066185f6fda95040636971e","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.0.2.tgz","fileCount":5,"integrity":"sha512-RNovNWd6KoyKAtBgB8hLeYMhqOKoq9RUSzMTxmvA0q2B8IrapWyBuICp5aNWhJjYt9SBfqlMuaRTbmEZLXLuxQ==","signatures":[{"sig":"MEUCIQDWMIbB6zJy0526J8PBY+4vdXOOYlxlDNDf5U79+Lg07QIgKEfzUKI2vTW8X/QO8XhgwpeTo0fcn0U62W6/1bMR/4M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19615},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"1f816cc2ae85a9b2009840c36d09a49e5124fce6","scripts":{"dev":"vite","build":"tsc","format":"npx prettier --write .","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"11.4.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"24.4.0","_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.0.2_1756150108215_0.12034162567542772","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.0.3","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.0.3","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"324cef387fd9b263c8f29c40b9591d925d3dae45","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.0.3.tgz","fileCount":5,"integrity":"sha512-HNaLaz6w96+2tH2RBWTFzUIHR7xy8mzBGCf39595gqoSoiu8aVjXG5P3jAEPuWmA/QQ4JpPh0lq8JDc2fGcngQ==","signatures":[{"sig":"MEQCIGuCvi1sQYJqNGgR2wsFQYN1Bnno+MYNzNEfjJwJhZeQAiA9ahBgtobAiYtAlaujm+zuTVS+du3wGTmDRhUB40f2Cw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20622},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"d1b21aad9019a083c53605458f94ceedcb9a5b99","scripts":{"dev":"vite","build":"tsc","format":"npx prettier --write .","preview":"vite preview","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.0.3_1756157184372_0.5293259921654081","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.2.0","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.2.0","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"9d30b7594672312bdf52f895d27259f813062f0a","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.2.0.tgz","fileCount":5,"integrity":"sha512-Yjp2LKdWlTnyqcl7ffnl8hHpDGlXwrbVrv3FeNHT8/FzEohZ4E+X+XxZe+epS4r7gz97UlbxpvI4YoMFQKi83w==","signatures":[{"sig":"MEYCIQDdm9WOsdYKG8NoE8fwIkOxamSgQuHTWQdH0p6DT2srLQIhAIfxia7b5nS3X+46Q2tbAHbB0SpDEPsVtbEzJx6cbwvQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26655},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"ac930aca783b2701bb1dc125cbbdc76d42fa336f","scripts":{"dev":"vite","test":"playwright test","build":"tsc","format":"npx prettier --write .","preview":"vite preview","test:ui":"playwright test --ui","test:debug":"playwright test --debug","test:headed":"playwright test --headed","test:report":"playwright show-report","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1","@types/micromatch":"^4.0.9"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.2.0_1756410643081_0.723523692147406","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.3.0","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.3.0","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"19bbe5b40ed6436482be9e66f333cae4c33e046b","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.3.0.tgz","fileCount":5,"integrity":"sha512-OQX9TbDQcXRHpCO8YW58tm2pAEE7S7kFf31DT6SurhHCjM+k9LGYSFHu4uwxv62lWvibMLCMuO0IIin9HQTojg==","signatures":[{"sig":"MEUCIQC2U+U3Evj8KxoSsqMp8H/b+n2deEPX13WGWPnqcUf+ZQIgTLATgh61v1lXQuxAvWkWrBmkhjy51RXOBEJWTCILdGo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28847},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"99e8693738afe002308e2981cebeb6feaaa1821b","scripts":{"dev":"vite","test":"playwright test","build":"tsc","format":"npx prettier --write .","preview":"vite preview","test:ui":"playwright test --ui","test:debug":"playwright test --debug","test:headed":"playwright test --headed","test:report":"playwright show-report","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1","@types/micromatch":"^4.0.9"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.3.0_1756413047295_0.6151200310421461","host":"s3://npm-registry-packages-npm-production"}},"2.3.1":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.3.1","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.3.1","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"1fc9919fb49bd66b2d522ff8624e27f6e739731d","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.3.1.tgz","fileCount":5,"integrity":"sha512-JIoQyxNLswQXJfY/Xi4XTsGEigFZWuOKeGu7tZhK+Q6kH/rA7zOvyj8uW6dj8w6sMMnEjub7mmaLSXAxHnmEzA==","signatures":[{"sig":"MEYCIQDp+qokGQ+pjkOi2xrRbyMPH5NbPhAa9gorIJaYYbuJbgIhAJKBE7+ob0tNdZWhnggNO2AsabUEQYxm426k5Rq/Dqre","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29077},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"69dcb9c00289d348c1c0ad082f5e29dbf025672b","scripts":{"dev":"vite","test":"playwright test","build":"tsc","format":"npx prettier --write .","preview":"vite preview","test:ui":"playwright test --ui","test:debug":"playwright test --debug","test:headed":"playwright test --headed","test:report":"playwright show-report","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1","@types/micromatch":"^4.0.9"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.3.1_1756422743865_0.5484195655379365","host":"s3://npm-registry-packages-npm-production"}},"2.3.2":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.3.2","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.3.2","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"b429375aaed6961e1cd4039dcbfc92ead114c524","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.3.2.tgz","fileCount":5,"integrity":"sha512-JR/ywUgbKa080+f62MGALdpRxC+7CY9JO3MBLZRwHT8IDnBCZUWn4j3F8fntwHHGLiohEurMj1mZ2djjMNKofw==","signatures":[{"sig":"MEUCIQCsdu42xWoFgF5ejU/MNuY/SlvfNi+yMuaIlAx8sURlugIgZ15h4pTs7n/EdW0mQZveS8aI+p/clr/KJIiRmK1A8qM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29257},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"f994e4fb085807be0565c5770fcb00cf49c354e7","scripts":{"dev":"vite","test":"playwright test","build":"tsc","format":"npx prettier --write .","preview":"vite preview","test:ui":"playwright test --ui","test:debug":"playwright test --debug","test:headed":"playwright test --headed","test:report":"playwright show-report","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1","@types/micromatch":"^4.0.9"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.3.2_1756422998553_0.7832062062660237","host":"s3://npm-registry-packages-npm-production"}},"2.3.3":{"name":"@0xbigboss/vite-console-forward-plugin","version":"2.3.3","keywords":["vite","plugin","console","logging","development","debugging"],"author":{"name":"0xBigBoss"},"license":"MIT","_id":"@0xbigboss/vite-console-forward-plugin@2.3.3","maintainers":[{"name":"0xbigboss","email":"0xbigboss@proton.me"}],"homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"dist":{"shasum":"7556c42999e00e891a5622484262ad21f0841d89","tarball":"https://registry.npmjs.org/@0xbigboss/vite-console-forward-plugin/-/vite-console-forward-plugin-2.3.3.tgz","fileCount":5,"integrity":"sha512-c9CQm617I3HHhrD9grtqfNVy0jmwoD+y0Eu0wgeMR8QdLnqOeiUw5AGxpoTvgS/9/UDAr7XUOhU39F2m92urUg==","signatures":[{"sig":"MEUCIAGsq/NRAwLBLcbA7xLpZGDPJ3rH8NRsFp6l4VMKKlGoAiEAgACup1/rOdrQdXe5Egvco9IjVzhMXq+RUVtKlFqDlXU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29308},"main":"dist/vite-console-forward-plugin.js","type":"module","types":"dist/vite-console-forward-plugin.d.ts","gitHead":"07b8869366f1e0cbcbbed3b345c4fe7b142b15de","scripts":{"dev":"vite","test":"playwright test","build":"tsc","format":"npx prettier --write .","preview":"vite preview","test:ui":"playwright test --ui","test:debug":"playwright test --debug","test:headed":"playwright test --headed","test:report":"playwright show-report","prepublishOnly":"npm run build"},"_npmUser":{"name":"0xbigboss","email":"0xbigboss@proton.me"},"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"_npmVersion":"10.9.2","description":"A Vite plugin that forwards browser console logs to the Vite dev server console","directories":{},"_nodeVersion":"22.15.0","dependencies":{"micromatch":"^4.0.8"},"_hasShrinkwrap":false,"devDependencies":{"playwright":"^1.53.1","typescript":"^5.0.0","@types/node":"^24.0.7","@playwright/test":"^1.53.1","@types/micromatch":"^4.0.9"},"peerDependencies":{"vite":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/vite-console-forward-plugin_2.3.3_1756442680204_0.1685049502133953","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-08-25T06:00:56.304Z","modified":"2026-06-24T17:39:23.640Z","2.0.1":"2025-08-25T06:00:56.622Z","2.0.2":"2025-08-25T19:28:28.424Z","2.0.3":"2025-08-25T21:26:24.537Z","2.2.0":"2025-08-28T19:50:43.271Z","2.3.0":"2025-08-28T20:30:47.570Z","2.3.1":"2025-08-28T23:12:24.057Z","2.3.2":"2025-08-28T23:16:38.763Z","2.3.3":"2025-08-29T04:44:40.411Z"},"bugs":{"url":"https://github.com/0xBigBoss/vite-console-forward-plugin/issues"},"author":{"name":"0xBigBoss"},"license":"MIT","homepage":"https://github.com/0xBigBoss/vite-console-forward-plugin#readme","keywords":["vite","plugin","console","logging","development","debugging"],"repository":{"url":"git+https://github.com/0xBigBoss/vite-console-forward-plugin.git","type":"git"},"description":"A Vite plugin that forwards browser console logs to the Vite dev server console","maintainers":[{"email":"0xbigboss@proton.me","name":"alleneubank"}],"readme":"# vite-console-forward-plugin\n\nA Vite plugin that forwards browser console logs to the Vite dev server console for better debugging experience during development.\n\n## What it does\n\nThis plugin intercepts browser console logs (`console.log`, `console.warn`, `console.error`, etc.) and forwards them to your Vite dev server console with module-aware tracking. This is particularly useful when:\n\n- Debugging client-side JavaScript in environments where browser dev tools aren't easily accessible\n- You want to see all application logs in one place with module context (e.g., `[background]`, `[content]`)\n- Working with mobile devices or embedded browsers\n- Running automated tests and want console output in your CI logs\n- Developing browser extensions where logs from different contexts need to be tracked separately\n\n<img src=\"log.png\" alt=\"Screenshot\" width=500>\n\n## Installation\n\nSince this is a single-file plugin, you can copy `vite-console-forward-plugin.ts` directly into your project, or install it as a local dependency.\n\n## Usage\n\nAdd the plugin to your `vite.config.ts`:\n\n### Basic Setup (Web Applications)\n```typescript\nimport { defineConfig } from \"vite\";\nimport { consoleForwardPlugin } from \"./vite-console-forward-plugin\";\n\nexport default defineConfig({\n  plugins: [\n    consoleForwardPlugin({\n      // Default configuration works for most web apps\n      // Automatically injects into all HTML files\n    }),\n  ],\n});\n```\n\n### Advanced Setup (Custom Configuration)\n```typescript\nimport { defineConfig } from \"vite\";\nimport { consoleForwardPlugin } from \"./vite-console-forward-plugin\";\n\nexport default defineConfig({\n  plugins: [\n    consoleForwardPlugin({\n      // Include JavaScript/TypeScript files directly\n      injectPatterns: [\n        \"**/*.{js,jsx,ts,tsx,html}\"\n      ],\n      \n      // Exclude test files and specific directories\n      excludePatterns: [\n        \"**/node_modules/**\",\n        \"**/*.test.{js,ts}\",\n        \"**/dist/**\"\n      ],\n\n      // Custom module name extraction\n      moduleExtractor: (id: string) => {\n        // Extract meaningful module names from file paths\n        if (id.includes(\"/components/\")) return \"component\";\n        if (id.includes(\"/utils/\")) return \"utils\";\n        if (id.includes(\"/api/\")) return \"api\";\n        return \"app\";\n      },\n      \n      // Forward errors and promise rejections\n      forwardErrors: true,\n    }),\n  ],\n});\n```\n\n## Configuration\n\nThe `consoleForwardPlugin` accepts an options object with the following properties:\n\n| Option            | Type                             | Default                                     | Description                                        |\n| ----------------- | -------------------------------- | ------------------------------------------- | -------------------------------------------------- |\n| `enabled`         | `boolean`                        | `true`                                      | Whether to enable console forwarding               |\n| `endpoint`        | `string`                         | `\"/api/debug/client-logs\"`                  | API endpoint path for receiving logs               |\n| `levels`          | `string[]`                       | `[\"log\", \"warn\", \"error\", \"info\", \"debug\"]` | Console levels to forward                          |\n| `injectPatterns`  | `string[]`                       | `[\"**/*.html\"]`                             | Glob patterns for files to inject console forwarding |\n| `excludePatterns` | `string[]`                       | `[\"**/node_modules/**\"]`                    | Glob patterns for files to exclude from injection |\n| `moduleExtractor` | `(id: string) => string`         | Built-in path parser                        | Custom function to extract module names from paths |\n| `silentOnError`   | `boolean`                        | `true`                                      | Don't show console warnings when server is down   |\n| `forwardErrors`   | `boolean`                        | `true`                                      | Forward uncaught errors and promise rejections    |\n\n## Pattern Matching with Glob\n\nThe plugin uses [micromatch](https://github.com/micromatch/micromatch) for powerful glob pattern matching:\n\n### Default Behavior\nBy default, the plugin only injects into HTML files (`[\"**/*.html\"]`). This is perfect for standard web applications where all JavaScript is loaded through HTML pages.\n\n### Custom Patterns\nYou can customize which files receive console forwarding using glob patterns:\n\n```typescript\nconsoleForwardPlugin({\n  // Include all JavaScript and TypeScript files\n  injectPatterns: [\"**/*.{js,jsx,ts,tsx}\"],\n  \n  // Exclude test files and node_modules\n  excludePatterns: [\"**/node_modules/**\", \"**/*.test.{js,ts}\", \"**/*.spec.{js,ts}\"]\n})\n```\n\n### Common Pattern Examples\n- `\"**/*.js\"` - All JavaScript files\n- `\"src/**/*.{ts,tsx}\"` - TypeScript files in src directory\n- `\"!**/*.min.js\"` - Exclude minified files\n- `\"**/components/**/*.jsx\"` - JSX files in any components directory\n\n## Browser Extensions\n\nFor browser extension development, you'll need to specify your extension's entry points since they don't run through HTML files:\n\n```typescript\nconsoleForwardPlugin({\n  enabled: isDev,\n  // Target specific extension entry points\n  injectPatterns: [\n    \"**/entries/background/**/*.{ts,js}\",\n    \"**/entries/content/**/*.{ts,js}\", \n    \"**/entries/popup/**/*.{tsx,jsx}\",\n    \"**/entries/options/**/*.{tsx,jsx}\",\n  ],\n  // Custom module extraction for cleaner logs\n  moduleExtractor: (id) => {\n    if (id.includes(\"/background/\")) return \"background\";\n    if (id.includes(\"/content/\")) return \"content\"; \n    if (id.includes(\"/popup/\")) return \"popup\";\n    if (id.includes(\"/options/\")) return \"options\";\n    return \"extension\";\n  },\n})\n```\n\nThis will show logs like `[background] User logged in` or `[content] Page loaded`, making it easy to track which part of your extension is generating each log.\n\n### Web Workers and Service Workers\nFor applications using workers, add their scripts to the patterns:\n\n```typescript\nconsoleForwardPlugin({\n  injectPatterns: [\n    \"**/*.html\",\n    \"**/workers/**/*.js\",\n    \"**/service-worker.js\"\n  ],\n  moduleExtractor: (id) => {\n    if (id.includes(\"service-worker\")) return \"service-worker\";\n    if (id.includes(\"/workers/\")) return \"worker\";\n    return defaultModuleExtractor(id);\n  }\n})\n```\n\n## How it works\n\n1. **Client-side**: The plugin transforms your code to patch browser console methods\n2. **Module tracking**: Each log is tagged with its source module for better organization\n3. **Buffering**: Console logs are buffered and sent in batches to reduce network overhead\n4. **Server-side**: A middleware endpoint receives the logs and outputs them using Vite's logger with module prefixes\n5. **Formatting**: Logs maintain their original formatting and include stack traces for errors\n6. **Error handling**: Network failures are handled gracefully without breaking your application\n\n## Simple Error Handling\n\nThe plugin includes simple, robust error handling for when the development server is unavailable:\n\n- **Silent failures**: By default, connection errors are silent to avoid console noise (set `silentOnError: false` to see errors)\n- **Graceful degradation**: Failed requests are simply ignored, your application continues normally\n- **No retry complexity**: Keeps the implementation simple and predictable\n\nThis ensures your application continues to work normally even when the dev server is down, without generating `ERR_CONNECTION_REFUSED` errors in the browser console.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}