
The web has always had an uneasy relationship with connectivity. Most applications are designed as if the network will be […]

Streaming AI responses is one of the easiest ways to improve UX. Here’s how to implement it in a Next.js app using the Vercel AI SDK—typing effect, reasoning, and all.

Learn how React Router’s Middleware API fixes leaky redirects and redundant data fetching in protected routes.

A developer’s retrospective on creating an AI video transcription agent with Mastra, an open-source TypeScript framework for building AI agents.
Hey there, want to help make our blog better?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
3 Replies to "How to detect dead code in a frontend project"
Great article! 👍
Regarding this part 👇
> The plugin will report unused files and unused exports into your terminal but those are not part of your webpack build process, therefore, it will not fail your build
According to their docs, there is a way `failOnHint` to fail the build if the `webpack-deadcode-plugin` finds something.
> options.failOnHint (default: false)
> Deadcode does not interrupt the compilation by default. If you want to cancel the compilation, set it true, it throws a fatal error and stops the compilation.
https://github.com/MQuy/webpack-deadcode-plugin#optionsfailonhint-default-false
Great point, indeed 👍 Thanks for pointing it out – definitely good to keep this option in mind if you want to use `webpack-deadcode-plugin` in CI!
One small remark 🙂
You don’t need to install depcheck before `npx depcheck`. There are just two options: do `npm i -g depcheck` or `npx depcheck`