Skip to content

[Bug]: dts.alias does not work as expected #1390

@chenjiahan

Description

@chenjiahan

Version

System:
    OS: macOS 26.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 7.86 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 142.0.7444.176
    Safari: 26.1
  npmPackages:
    @rslib/core: 0.18.3 => 0.18.3

Details

  • source:
import type RspackChain from 'rspack-chain';
  • config:
      dts: {
        build: true,
        tsgo: !process.env.CI,
        alias: {
          'rspack-chain': '../../compiled/rspack-chain',
        },
      },
  • output:
// current
import type RspackChain from 'rspack-chain';

// expected
import type RspackChain from '../../compiled/rspack-chain';

Reproduce link

https://github.com/web-infra-dev/rsbuild/tree/rspack_chain_dts_1209

Reproduce Steps

  1. pnpm i
  2. cd packages/core
  3. pnpm build
  4. check `packages/core/dist-types/types/rspack.d.ts·

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions