Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not support relative path support for typescript baseUrl or Paths #8604

Open
gautamsi opened this issue Jun 4, 2023 · 2 comments
Open

Comments

@gautamsi
Copy link
Member

gautamsi commented Jun 4, 2023

  • Add tsconfig.json option for baseUrl or paths option, for example "baseUrl": "./src" or "paths": {"@/*", "./src/*"}
  • import anything using the aliases
    it breaks with module not found error

Expected to work without issue

I see that the esbuild custom plugin to blame here which excludes anything not starting with . as external.

I have came across this page: https://janessagarrow.com/blog/typescript-and-esbuild/ which has example using package.json dependencies as external.
I have tried it and that works with @manypkg/find-root. I had to get the package.json dependencies and mark them external rather than the custom plugin. I prefer using find-root instead of just getting cwd+package.json in getEsbuildConfig, this enable use case where keystone cli is used from within another package.

if interested, I can add example here.

Also found some example to achieve this as evanw/esbuild#619 (comment)

@acburdine
Copy link
Member

acburdine commented Jun 9, 2023

I started a similar discussion about this a couple months ago.

Something akin to Next.js's transpilePackages feature might work well, but I think the main difficulty is how to actually specify said configuration, given that the entire Keystone configuration currently lives in the file that gets transpiled.

@acburdine
Copy link
Member

also, possible duplicate of #8537?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants