wip: consider tsconfig aliases when resolving content layer image paths #14843
+43
−9
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.
Changes
Tries to potentially address #14766 by using the aliases from tsconfig.
I personally had an issue with #14590 because I use an alias with
$rather than the astro convention of@. I figured that one option to fix this is to utilise the resolution from theastro:tsconfig-aliasplugin.Now this does work currently, IF you're using this alias feature (i.e. not using vite replacements) AND you don't include a
baseUrlin your tsconfig. Since the base url changes how relative paths are resolved, it would actually circumvent the changes made in #14766 sincefoo.png, for example, would match the base url regex.I need a break, but will look into this a little more later and hopefully figure out why the markdown resolution is working fine. Putting this up now though in case anyone else has any insight.
Testing
Tests have been added and need some further work
Docs
n/a