-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Vite: Fix issues when loading files via static asset queries #14716
Merged
graphite-app
merged 1 commit into
next
from
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
Oct 22, 2024
Merged
Vite: Fix issues when loading files via static asset queries #14716
graphite-app
merged 1 commit into
next
from
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
Oct 22, 2024
Conversation
This file contains 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
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @philipp-spiess and the rest of your teammates on Graphite |
philipp-spiess
force-pushed
the
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
branch
2 times, most recently
from
October 18, 2024 14:27
ff819b4
to
b270f30
Compare
adamwathan
reviewed
Oct 18, 2024
philipp-spiess
force-pushed
the
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
branch
from
October 21, 2024 09:08
b270f30
to
1aa561f
Compare
philipp-spiess
force-pushed
the
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
branch
from
October 21, 2024 10:45
1aa561f
to
53e2159
Compare
philipp-spiess
force-pushed
the
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
branch
from
October 22, 2024 11:33
53e2159
to
5655525
Compare
philipp-spiess
commented
Oct 22, 2024
thecrypticace
approved these changes
Oct 22, 2024
RobinMalfait
approved these changes
Oct 22, 2024
Merge activity
|
Fixes: #14558 This PR fixes an issue where our Vite plugin would crash when trying to load stylesheets via certain static asset query parameters: ```ts import raw from './style.css?raw' import url from './style.css?url' ``` The proper behavior for our extension is to _not touch these file at all_. The `?raw` identifier should never transform anything and the `?url` one will emit a module which points to the asset URL. However, if that URL is loaded as a stylesheet, another transform hook is called and the file is properly transformed. I verified this in the Vite setup and have added an integration test ensuring these two features work as expected. I've also greatly reduced the complexity of the Vite playground to make it easier to set up examples like this in the future.
philipp-spiess
force-pushed
the
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
branch
from
October 22, 2024 16:03
92457e7
to
d59f1b3
Compare
graphite-app
bot
deleted the
10-18-vite_fix_issues_when_loading_files_via_static_asset_queries
branch
October 22, 2024 16:08
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.
Fixes: #14558
This PR fixes an issue where our Vite plugin would crash when trying to load stylesheets via certain static asset query parameters:
The proper behavior for our extension is to not touch these file at all. The
?raw
identifier should never transform anything and the?url
one will emit a module which points to the asset URL. However, if that URL is loaded as a stylesheet, another transform hook is called and the file is properly transformed. I verified this in the Vite setup and have added an integration test ensuring these two features work as expected.I've also greatly reduced the complexity of the Vite playground to make it easier to set up examples like this in the future.