question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v2.2.3 fails to rewrite alias path in decleration file, reverted back to v2.2.1

See original GitHub issue

snippet from tsconfig.json file

 { "transform": "typescript-transform-paths", "afterDeclarations": true }

replacing path aliases in decleration files does not work in (current) version 2.2.3 (i reverted back to 2.2.1 and it works with this version)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
nonaracommented, Mar 19, 2021

GH didn’t send me an email on this, so I didn’t see it until now.

It looks to me like you’ve not added both lines to the config file. If you want to translate for both js and types, you need two entries in plugins.

Essentially, the TS compiler is built so that JS and type definitions are two separate transform cycles being performed at different stages and, consequently, with different variants of the AST. The plugin needs to be fed in for each that you want it to intercept.

ie (for both):

    "plugins": [
      { "transform": "typescript-transform-paths" },
      { "transform": "typescript-transform-paths", "afterDeclarations": true }
    ]

Let me know if that helps!

1reaction
nonaracommented, Mar 20, 2021

No problem. Glad it’s working for you! Take care.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve path alias in declaration files ( .d.ts ) #201 - GitHub
When applying a path alias to a typescript project, the path is resolved in the emitted javascript files, but not in the declaration...
Read more >
Typescript declaration file created with alias instead of relative ...
When I try to consume the library in another typescript app, the build fails due to invalid type declaration file which is being...
Read more >
Documentation - TypeScript 4.2
TypeScript has a way to declare new names for types called type aliases. If you're writing a set of functions that all work...
Read more >
Spark SQL, DataFrames and Datasets Guide
DataFrames can be constructed from a wide array of sources such as: structured data files, tables in Hive, external databases, or existing RDDs....
Read more >
PRU Optimizing C/C++ Compiler v2.3 User's Guide (Rev. C)
Section 2.5.2.1. --preinclude=filename. Includes filename at the beginning of compilation. Section 2.3.3. Table 2-6. Control Options. Option. Alias.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found