Skip to content

v2.64.0 — Webpack alias parity + bundler entry path fixes

Choose a tag to compare

@BartWaardenburg BartWaardenburg released this 04 May 20:39
· 87 commits to main since this release
v2.64.0
6a1cc5c

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 write entry: './src/app.ts'. The matcher compiles globs with literal_separator(true), so ./src/app.ts would never match the project-relative path src/app.ts in 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 a export * from './queries' barrel. Thanks @filipw01. (Closes #269)
  • Public-package class members are no longer flagged as unused. Classes re-exported from a publicPackages workspace 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, so pages.adminPage.method() credits the method on the POM class. Thanks @vethman. (Closes #268)
  • .gts (Glimmer TypeScript) imports honor tsconfig.json#paths aliases. Ember + Glimmer projects with paths: { "@app/*": ["src/*"] } no longer surface every aliased import as unresolved-import. Thanks @square-brackets. (Closes #270)
  • vitest.config.* and Storybook story conventions stop appearing as unused under --include-entry-exports. The Vitest plugin contributes used_exports for vitest.config.* / vitest.workspace.* (default), and the Storybook plugin contributes a * wildcard for **/*.stories.* and .storybook/**. The wildcard required restoring symmetry in is_export_ignored so plugin-supplied used_exports honor * the same way user-config ignoreExports already did. Thanks @filipw01. (Fixes #271)

Full Changelog: v2.63.0...v2.64.0