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(manifest): preserve pure css chunk assets #14297

Merged
merged 7 commits into from Sep 10, 2023

Conversation

sun0day
Copy link
Member

@sun0day sun0day commented Sep 5, 2023

Description

fix #14244

pureCssChunk will be removed totally with its importedAssets. Thus these importedAssets would be orphaned in the manifest.json.

This PR tries to preserve these importedAssets via attaching them with pureCssChunk's emitted css.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@stackblitz
Copy link

stackblitz bot commented Sep 5, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sun0day
Copy link
Member Author

sun0day commented Sep 5, 2023

Can you help check this PR in svelte-kit? Thanks @benmccann

@sapphi-red
Copy link
Member

I wonder if it's possible to handle when removing the pure CSS chunk.

if (pureCssChunkNames.includes(file)) {
const { importedCss } = (bundle[file] as OutputChunk)
.viteMetadata!
importedCss.forEach((file) =>
chunk.viteMetadata!.importedCss.add(file),
)
return false
}

@sapphi-red sapphi-red added the p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) label Sep 6, 2023
@sun0day
Copy link
Member Author

sun0day commented Sep 7, 2023

I wonder if it's possible to handle when removing the pure CSS chunk.

Yeah ,that would be more simple 👍

@benmccann
Copy link
Collaborator

Can you help check this PR in svelte-kit? Thanks @benmccann

Yes, I see SvelteKit generating the preload header tags when linked against this PR. Thank you so much for fixing this!!

@bluwy
Copy link
Member

bluwy commented Sep 8, 2023

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Sep 8, 2023

📝 Ran ecosystem CI: Open

suite result
analogjs ✅ success
astro ✅ success
histoire ❌ failure
ladle ❌ failure
laravel ✅ success
marko ✅ success
nuxt ✅ success
nx ✅ success
previewjs ✅ success
qwik ✅ success
rakkas ✅ success
sveltekit ✅ success
unocss ❌ failure
vite-plugin-pwa ✅ success
vite-plugin-ssr ✅ success
vite-plugin-react ✅ success
vite-plugin-react-pages ❌ failure
vite-plugin-react-swc ✅ success
vite-plugin-svelte ❌ failure
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ✅ success

@bluwy
Copy link
Member

bluwy commented Sep 8, 2023

Looks like the ones that passed in main also passed here.

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sapphi-red sapphi-red merged commit 4bf31e5 into vitejs:main Sep 10, 2023
10 of 11 checks passed
Gaubee pushed a commit to Gaubee/vite that referenced this pull request Sep 13, 2023
@bluwy bluwy mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preloading broken due to unreferenced fonts in Vite manifest
4 participants