fix: export all of @astrojs/image dist #4146
Merged
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
I'm attempting to build a
remark
plugin that takes allimg
tags from a non-MDX Markdown file and pass them togetImages
. However, there's a problem in doing so with this line of code, which attempts to import fromvirtual:image-loader
.This is a problem, however, since
virtual:
plugins are only available within a Vite context, which theastro.config.ts
file is not within.As such, I've found a workaround by creating
global.astroImage
manually:To avoid this
if
condition. This solution works well enough for my needs for now.This change was suggested in part by @FredKSchott to export all of
dist
instead of explicitly importing individual parts ofdist
.Testing
This was pulled into my project, which fixed the issue at hand.
Docs
No docs should be needed, this is more for folks living on the edge and writing internal-hooking plugins.