fix(images): Move emitESMImage util to another file #6505
Merged
+46
−44
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
emitESMImage
depends onrootRelativePath
which depends onvite
. As such, we need to be careful when importing it because importing it in the wrong context will cause a bunch of weird issues due to Vite trying to load things it shouldn't be loading (such as itself). Since it was ininternal.ts
, which gets imported from other sources, it would get imported sometimes in the wrong contexts.This was very confusing, but I think this work
Testing
Tests should still pass! I tested manually that this fix the issue I was running into, as it couldn't be reproduced either in local or in CI
Docs
N/A