
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
next-unused
Advanced tools
next-unused is an easy way to find unused files in your [Next.js](https://github.com/zeit/next.js) project.
next-unused is an easy way to find unused files in your Next.js project.
Make sure you install as a devDependency
, otherwise you will add 60mb+ to your build.
$ yarn add next-unused -D
In package.json
, add a script to find unused files:
"scripts": {
"find:unused": "next-unused"
}
Run the script to list any unused files: yarn find:unused
.
Add a property to your package.json
to configure next-unused:
{
"next-unused": {
"alias": {},
"include": [],
"exclude": [],
"entrypoints": []
}
}
Property | Type | Default | Description |
---|---|---|---|
debug | boolean | false | turn on debug messages |
alias | object | {} | import aliases in webpack format ({ "@components": "components/" } ) |
include | string[] | ['pages'] | list of directories to search through. pages is always included |
exclude | string[] | [] | array of RegExp that exclude matching filenames |
entrypoints | string[] | ['pages'] | list of directories to use as entrypoints. pages is always included |
Your Next.js setup looks like this:
package.json
āā pages/
ā āā index.js
āā components/
āā button.js
āā image.js
And your pages/index.js
contains:
import Button from '../components/button'
export default () => {
return (
<Button>Click me</Button>
)
}
Configure next-unused
to include the components
directory in package.json
:
{
"next-unused": {
"include": ["components"]
}
}
Running next-unused
will output:
Found 1 unused file:
components/image.js
Shu and Luc wrote the initial version of this script.
FAQs
next-unused is an easy way to find unused files in your [Next.js](https://github.com/zeit/next.js) project.
The npm package next-unused receives a total of 29,619 weekly downloads. As such, next-unused popularity was classified as popular.
We found that next-unused demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.