UNPKG

knip

Version:

Find unused files, dependencies and exports in your TypeScript and JavaScript projects

27 lines (26 loc) 907 B
import { hasDependency } from '../../util/plugin.js'; const title = 'Next.js'; const enablers = ['next']; const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers); const entry = ['next.config.{js,ts,cjs,mjs}']; const productionEntryFilePatternsWithoutSrc = [ '{instrumentation,middleware}.{js,ts}', 'app/global-error.{js,jsx,ts,tsx}', 'app/**/{error,layout,loading,not-found,page,template,default}.{js,jsx,ts,tsx}', 'app/**/route.{js,jsx,ts,tsx}', 'app/{manifest,sitemap,robots}.{js,ts}', 'app/**/{icon,apple-icon}.{js,jsx,ts,tsx}', 'app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}', 'pages/**/*.{js,jsx,ts,tsx}', ]; const production = [ ...productionEntryFilePatternsWithoutSrc, ...productionEntryFilePatternsWithoutSrc.map(pattern => `src/${pattern}`), ]; export default { title, enablers, isEnabled, entry, production, };