Usage with path aliases
See original GitHub issueI’ve set up some custom path aliases in my ts-config: ie:
"paths": {
"@themes": ["themes"],
"@themes/*": ["themes/*"],
},
Running this through rollup-plugin-ts
results in the below error
[!] (plugin Typescript) TS2307: Cannot find module '@themes'.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Simpler Typescript paths with path aliases - Christian Lüdemann
Typescript aliases allow you to specify a word/alias for an absolute path in the application from which you can resolve paths from absolutely....
Read more >Improving code readability with Path Aliases - Medium
Path aliasing or aliases are preconfigured names used to replace long paths in files and resolve to certain directories on a codebase. There ......
Read more >Path Aliases in TypeScript and why you should use them
So, let's explain how to use path aliases in Typescript. Imagine you have a project structure like the following one: Let's update your...
Read more >Path aliases with TypeScript in Node.js - Level Up Coding
With path aliases, you can declare aliases that map to a certain absolute path in your application.
Read more >How To Configure Path Aliases With TypeScript
In this article, I'll show how to configure path aliasing in a TypeScript project. ... To use the package, I'll add it to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright everyone, this issue has been fixed as part of v1.2.28 which will be released shortly. The problem was that
rollup-plugin-ts
always forced thebaseUrl
to.
, which made path mapping resolve to wrong paths for other values for thebaseUrl
. @marjorg, I’ve tested it against the feature branch of your repo, and it built successfully. I don’t need access to the repo anymore. Thanks, that made everything a lot easier!If it can help, i use @rollup/plugin-alias :