Skip to content

[plugin typescript] How to transform absolute path to relative path in declaration files output ? #1428

Closed

Description

@EricaLi123

env

rollup : ^3.12.0
node: 14.18.1

tsconfig

//tsconfig.json
{
   ...
    compileOptions:{
          ...
         "baseUrl": "./",
          "declarationDir": "types",
          "paths": {
                "@src/*": [
                    "src/*"
                ]
            },
    }
}

Code

//src/utils.ts
import a from "@src/constant"

rollup output declaration

actual

//dist/types/utils.d.ts
import a from "@src/constant"

expect

Relative path is my expected. What can i do for it?

//dist/types/utils.d.ts
import a from "../constant"

Activity

  1. locked and limited conversation to collaborators on Feb 10, 2023
  2. converted this issue into a discussion #1429 on Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions