Skip to content
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

fix: don't transform raw imports (fixes #87) #88

Merged
merged 2 commits into from
Jul 9, 2021

Conversation

mattjennings
Copy link
Contributor

This may be a naive fix so let me know if there are any concerns here.

@bluwy
Copy link
Member

bluwy commented Jul 9, 2021

The fix looks fine to me and @vitejs/plugin-vue seems to be doing the same. However, maybe we could ignore ?raw and ?url suffix all together at the parser level instead?

return parseToSvelteRequest(id, filename, rawQuery, normalizedRoot, timestamp, ssr);

If the parsed query has .raw or .url, we return undefined. That way we can simplify the if condition here as well:

if (!query.url && !query.raw && viteConfig.assetsInclude(filename)) {

cc @dominikg

@dominikg
Copy link
Member

dominikg commented Jul 9, 2021

I like @bluwy 's idea, think it could go here

with

// skip requests with special vite tags
if(query.raw || query.url) { return }

@mattjennings would you like to update the code accordingly and add a changeset with pnpx changeset ?

@dominikg
Copy link
Member

dominikg commented Jul 9, 2021

went ahead and did it myself to include it in the new version that is going to be released tonight. hope you don't mind.

@dominikg dominikg merged commit d1d2638 into sveltejs:main Jul 9, 2021
@github-actions github-actions bot mentioned this pull request Jul 9, 2021
@mattjennings mattjennings deleted the fix/svelte-raw-imports branch July 9, 2021 17:37
@mattjennings
Copy link
Contributor Author

Not at all!

@github-actions github-actions bot mentioned this pull request Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants