Skip to content

[Feature]: Support for DTS paths replacement #409

@chenjiahan

Description

@chenjiahan

What problem does this feature solve?

The compilerOptions#paths in tsconfig.json should work for DTS output.

Modern.js Module supports this, see https://github.com/web-infra-dev/modern.js/blob/main/packages/solutions/module-tools/src/utils/dts.ts#L116

  • tsconfig.json:
{
  "compilerOptions": {
    "paths": {
      "rslog": ["./compiled/rslog"]
    }
  },
  "include": ["src"]
}
  • src/index.ts:
import logger from 'rslog';
  • dist/index.d.ts:
import logger from '../compiled/rslog';

What does the proposed API look like?

This should work out of the box.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions