v2.64.0 — Webpack alias parity + bundler entry path fixes
Added
Webpack resolve.alias and entry context parsing
Webpack joins Vite, Nuxt, and SvelteKit on deep resolve.alias parsing. Aliases written as '@components': path.resolve(__dirname, 'src/components') (or path.join(__dirname, ...), or plain string values) now feed the resolver, so aliased imports stop surfacing as unresolved-import and files reachable only through an alias stop cascading as unused-file / unused-export.
The Webpack 5 entry-descriptor shape (entry: { app: { import: './src/app.ts' } }), object-array entries (entry: { app: ['./polyfill.ts', './app.ts'] }), and the optional top-level context: path.resolve(__dirname, 'src') are also recognized; entries normalize against the context path so descriptor + context configurations resolve end-to-end. Dynamic and function-valued entries remain out of scope.
Thanks @michaljuris for the detailed report. (Closes #273)
tap and tsd test runner support
Two new built-in plugins. tap activates from a tap dependency and treats node-tap's default test discovery (test/, tests/, __tests__/, *.test.* / *.spec.*, top-level test.* / tests.*) plus .taprc configs as reachable. tsd activates from a tsd dependency and treats .test-d.ts(x) declaration tests plus package.json#tsd.directory as reachable.
Fixed
- Bundler entry patterns with a leading
./now resolve. Webpack/Rollup/Rspack/Rsbuild/Rolldown configs commonly writeentry: './src/app.ts'. The matcher compiles globs withliteral_separator(true), so./src/app.tswould never match the project-relative pathsrc/app.tsin the file index. The prefix is now stripped at the push site. import * as ns from './x'namespace member access flows through re-exporting barrels. A namespace import flowing into an object literal and read via a chained property access now correctly credits the leaf member as used, even when the namespace target is itself aexport * from './queries'barrel. Thanks @filipw01. (Closes #269)- Public-package class members are no longer flagged as unused. Classes re-exported from a
publicPackagesworkspace package's entry are part of its public API; member methods that aren't called inside the workspace are now suppressed (matching how enum members already behaved). Non-public packages still report unused members. Thanks @ghost23. (Closes #267) - Playwright POM methods consumed through nested fixture types are credited. Nested object-literal fixture types (
{ pages: { adminPage: AdminPage } }) and named-alias variants (type PageFixtures = { adminPage: AdminPage }; type MyFixtures = { pages: PageFixtures }) now flow a dotted path through both the type-side and the destructure-side, sopages.adminPage.method()credits the method on the POM class. Thanks @vethman. (Closes #268) .gts(Glimmer TypeScript) imports honortsconfig.json#pathsaliases. Ember + Glimmer projects withpaths: { "@app/*": ["src/*"] }no longer surface every aliased import asunresolved-import. Thanks @square-brackets. (Closes #270)vitest.config.*and Storybook story conventions stop appearing as unused under--include-entry-exports. The Vitest plugin contributesused_exportsforvitest.config.*/vitest.workspace.*(default), and the Storybook plugin contributes a*wildcard for**/*.stories.*and.storybook/**. The wildcard required restoring symmetry inis_export_ignoredso plugin-suppliedused_exportshonor*the same way user-configignoreExportsalready did. Thanks @filipw01. (Fixes #271)
Full Changelog: v2.63.0...v2.64.0