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

contentlayer.config.ts should handle tsconfig paths #238

Open
stefanprobst opened this issue May 31, 2022 · 4 comments
Open

contentlayer.config.ts should handle tsconfig paths #238

stefanprobst opened this issue May 31, 2022 · 4 comments
Labels
blocked-upstream This issue is currently blocked by another problem/limitation in an upstream package meta: never-stale topic: typescript

Comments

@stefanprobst
Copy link
Contributor

stefanprobst commented May 31, 2022

using an absolute import defined via tsconfig.json#paths in contentlayer.config.ts currently throws a ConfigReadError

steps to reproduce:

  • git clone [email protected]:stefanprobst/issue-contentlayer-tsconfig-paths.git
  • cd issue-contentlayer-tsconfig-paths
  • npm i
  • npm run generate
@seancdavis
Copy link
Collaborator

@stefanprobst Will you please share the details of your error?

@stefanprobst
Copy link
Contributor Author

the above steps will print:
Screenshot_20220607_101451

@stefanprobst
Copy link
Contributor Author

i think what is happening is that esbuild knows how to resolve path aliases, but does not transform them (see evanw/esbuild#394). so when importing here this will then throw the ConfigError.

@schickling schickling added blocked-upstream This issue is currently blocked by another problem/limitation in an upstream package topic: typescript labels Jul 5, 2022
@schickling
Copy link
Collaborator

Thanks a lot for opening this issue @stefanprobst. I agree with your assessment and would for now suggest to put this on hold until there's a clear direction in regards to evanw/esbuild#394. (In case the official stance of the esbuild maintainers turns out to be to use a plugin for this, we can consider following that advise.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked-upstream This issue is currently blocked by another problem/limitation in an upstream package meta: never-stale topic: typescript
Projects
None yet
Development

No branches or pull requests

3 participants