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.

How to use path aliases

See original GitHub issue

I would like to use absolute path aliases but couldn’t figure out how to set it up with this project

I would like a path like this:

import { formatNumber } from "../../../utils"

be like this:

import { formatNumber } from "@utils"

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
egoistcommented, Sep 16, 2021

I’ll close this and further updates will be added to #409.

0reactions
bhvngtcommented, Nov 18, 2021

@egoist I have created a repo tsup-node-esm which replicates my issue.

I have realised that if I move tmp package to dependencies, it all seems to work out fine.

I do see that the code gets inlined during transpilation. Is there anyway to avoid that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 with TypeScript in Node.js - DEV Community ‍ ‍
In TypeScript you can avoid these "bad" looking imports with the help of path aliases. With path aliases you can declare aliases that...
Read more >
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 >
How To Configure Path Aliases With TypeScript
A path alias is a user-defined name that replaces a long relative path. Non-aliased relative import import { IUser } from "../../../../../.
Read more >
Path aliases with TypeScript in Node.js - Level Up Coding
In this article, I will walk you through setting up path aliases in your TypeScript project and show you how to clean up...
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