Update Documentation: tsconfig.json Aliases#6006
Merged
Merged
Conversation
"Clarify in the documentation that tsconfig.json aliases are not supported in the astro.config.ts file. Suggest using relative paths for module imports in this file instead of tsconfig.json aliases."
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Member
|
Thanks for hopping on this one! @VoxelMC , can I ask you to review? 🙌 |
|
|
||
| :::note | ||
| Vite-specific `import.meta` properties, like `import.meta.env` or `import.meta.glob`, are _not_ accessible from your configuration file. We recommend alternatives like [dotenv](https://github.com/motdotla/dotenv) or [fast-glob](https://github.com/mrmlnc/fast-glob) for these respective use cases. | ||
| Vite-specific `import.meta` properties, like `import.meta.env` or `import.meta.glob`, are _not_ accessible from your configuration file. We recommend alternatives like [dotenv](https://github.com/motdotla/dotenv) or [fast-glob](https://github.com/mrmlnc/fast-glob) for these respective use cases. Please note, that tsconfig aliases are not supported. For module imports in this file, we recommend using relative paths. |
Member
There was a problem hiding this comment.
Suggested change
| Vite-specific `import.meta` properties, like `import.meta.env` or `import.meta.glob`, are _not_ accessible from your configuration file. We recommend alternatives like [dotenv](https://github.com/motdotla/dotenv) or [fast-glob](https://github.com/mrmlnc/fast-glob) for these respective use cases. Please note, that tsconfig aliases are not supported. For module imports in this file, we recommend using relative paths. | |
| Vite-specific `import.meta` properties, like `import.meta.env` or `import.meta.glob`, are _not_ accessible from your configuration file. We recommend alternatives like [dotenv](https://github.com/motdotla/dotenv) or [fast-glob](https://github.com/mrmlnc/fast-glob) for these respective use cases. In addition, [tsconfig path aliases](https://www.typescriptlang.org/tsconfig#paths) will not be resolved. Use relative paths for module imports in this file. |
yt-kevincarrera
commented
Dec 31, 2023
Contributor
Author
yt-kevincarrera
left a comment
There was a problem hiding this comment.
Done!! Thanks for the help
Contributor
I just missed it; sorry about that! I'll be on the next ones. |
ematipico
pushed a commit
that referenced
this pull request
Jan 26, 2024
* Update Documentation: tsconfig.json Aliases "Clarify in the documentation that tsconfig.json aliases are not supported in the astro.config.ts file. Suggest using relative paths for module imports in this file instead of tsconfig.json aliases." * Actualizar configuring-astro.mdx * Update configuring-astro.mdx --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> Co-authored-by: Reuben Tier <64310361+TheOtterlord@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Clarify in the documentation that tsconfig.json aliases are not supported in the astro.config.ts file. Suggest using relative paths for module imports in this file instead of tsconfig.json aliases.
Related issues
compilerOptions.pathsintsconfigisn't respected for TypeScript Astro configs (astro.config.ts) #6003