davestewart / alias-hq

The end-to-end solution for configuring, refactoring, maintaining and using path aliases
https://davestewart.co.uk/projects/open-source/alias-hq/
MIT License
330 stars 11 forks source link

Load should also accept a ready imported TSConfig. #54

Open seivan opened 1 year ago

seivan commented 1 year ago

In my case I am importing a TSconfig for other stuff in the build script, and I don't see why I couldn't just pass the JSON directly to the loading, instead of giving it a name instead?

import * as TSconfig from "./tsconfig.dir.json"

Btw, you got the right idea here. There needs to be a single source of truth for these things, and all the other libraries need to just infer from it. Every other library seems to spread thoses aliases into different parts.

Personally, I think Yarn (Berry) has it right, by keeping the aliases as the other packages, but it doesn't work so well with Rollup.

TSConfig is the next best thing

davestewart commented 1 year ago

Hey, sorry for missing this! Been a busy 12 months.

So you're asking to directly pass a complete JSON object to the load method?

Are you asking for this as a performance gain, or perhaps you're doing some parsing first?

Just trying to work out why you want it...