Giter Site home page Giter Site logo

Comments (9)

justkey007 avatar justkey007 commented on May 26, 2024 2

@haoadoresorange
How setting only baseUrl has a similar effect? Are you saying that without defining the paths option in tsconfig you can use aliases using only baseUrl?

from tsc-alias.

raouldeheer avatar raouldeheer commented on May 26, 2024 2

The requested behavior is that "index" will be replaced by "${baseurl}/index". Where index can be any path in the baseurl directory.

from tsc-alias.

raouldeheer avatar raouldeheer commented on May 26, 2024 1

Right now it wouldn't work, because tsc-alias makes a list of all aliases and matches that with the imports. So when paths is empty there won't be any aliases to match so it won't find any results.

from tsc-alias.

raouldeheer avatar raouldeheer commented on May 26, 2024 1

I've got a prototype of this feature working; I'll improve it tomorrow. Haven't fully tested it yet so I'm not sure if it's a viable solution.

from tsc-alias.

ChrisChiasson avatar ChrisChiasson commented on May 26, 2024 1

@raouldeheer it seems like if we want baseUrl=".", so that absolute imports start with src/ we would need paths: {"src/*": "src/*"} in tsconfig.json. I was able to figure this out by taking project 16 from PR #67 and changing baseUrl and all the imports. I used project 10 for comparison. Thank you for your work on this project!

from tsc-alias.

raouldeheer avatar raouldeheer commented on May 26, 2024

Do you mean this?

from tsc-alias.

haoadoreorange avatar haoadoreorange commented on May 26, 2024

hmm no I mean, currently tsc-alias work with paths field in tsconfig. But setting only baseUrl has similar effect, could it work with that only ?

from tsc-alias.

haoadoreorange avatar haoadoreorange commented on May 26, 2024

is that something viable ?

from tsc-alias.

justkey007 avatar justkey007 commented on May 26, 2024

@raouldeheer @haoadoresorange
Thank you, the request was well understood

from tsc-alias.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.