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(build): invalidate chunk hash when css changed #11475

Merged
merged 2 commits into from Dec 23, 2022
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Dec 23, 2022

Description

fix #9583

Use Rollup's augmentChunkHash hook to ensure hash takes account of chunk.viteMetadata.importedCss

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.

@bluwy bluwy added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) feat: build labels Dec 23, 2022
patak-dev
patak-dev previously approved these changes Dec 23, 2022
@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Dec 23, 2022

📝 Ran ecosystem CI: Open

suite result
astro ✅ success
histoire ✅ success
iles ✅ success
ladle ✅ success
laravel ✅ success
marko ✅ success
nuxt-framework ✅ success
previewjs ✅ success
rakkas ✅ success
sveltekit ✅ success
vite-plugin-ssr ✅ success
vite-plugin-react ✅ success
vite-plugin-react-swc ✅ success
vite-plugin-svelte ✅ success
vite-plugin-vue ✅ success
vite-setup-catalogue ✅ success
vitepress ✅ success
vitest ❌ failure
windicss ✅ success

@bluwy
Copy link
Member Author

bluwy commented Dec 23, 2022

Looks like there's this TypeError: Cannot read properties of undefined (reading 'importedCss') error in Vitest. I'm not sure how that happens since we always add the metadata to all chunks in the metadata plugin, but I added an optional chain anyways to workaround the issue for now.

@patak-dev
Copy link
Member

/ecosystem-ci run vitest

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Dec 23, 2022

📝 Ran ecosystem CI: Open

suite result
vitest ✅ success

@patak-dev patak-dev merged commit 7a97a04 into main Dec 23, 2022
@patak-dev patak-dev deleted the build-css-hash branch December 23, 2022 14:51
@tessro
Copy link

tessro commented Dec 23, 2022

Thank you!! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: build feat: css p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hash of the main chunk not changed when only modify dynamic sub component css code
3 participants