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: preserve extension of css assets in the manifest #8768

Merged
merged 5 commits into from
Jun 27, 2022

Conversation

ElMassimo
Copy link
Contributor

@ElMassimo ElMassimo commented Jun 24, 2022

Description

Fixes #8764 by preserving the original extension for CSS asset entry names in the manifest.

It also preserves isEntry information for CSS asset chunks, which is useful for backend integrations.

Additional context

#6649 added assets to the manifest, but the entries are invalid for Sass/Less/Stylus stylesheets, as it's erasing the original extension from the manifest entry names and src.

What is the purpose of this pull request?

  • Bug fix

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

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit 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.

@netlify
Copy link

netlify bot commented Jun 24, 2022

Deploy Preview for vite-docs-main canceled.

Name Link
🔨 Latest commit 5239fe6
🔍 Latest deploy log https://app.netlify.com/sites/vite-docs-main/deploys/62b5f4ba87a743000824daca

@ElMassimo
Copy link
Contributor Author

@jessarcher @innocenzi Would you check if this commit is desirable or not?

Not sure how the Laravel plugins are using isEntry.

@ElMassimo ElMassimo changed the title fix: preserve original extension of css assets fix: preserve extension of css assets in the manifest Jun 25, 2022
@innocenzi
Copy link
Contributor

If I understood correctly what pure CSS chunks are, LGTM 👍

I use isEntry to know if an asset should have its own tag generated automatically (or on-demand in certain cases). I expect everything under build.rollupOptions.input to be an "isEntry" asset.

@jessarcher
Copy link
Contributor

@ElMassimo This looks great, thanks!

I've tested it out with both .css and .scss files and the manifest generates as expected 👍

The official Laravel plugin isn't actually using isEntry at the moment, but I'm glad that it's there!

@patak-dev patak-dev merged commit 9508549 into vitejs:main Jun 27, 2022
@patak-dev
Copy link
Member

Thanks for the feature review and quick fix @ElMassimo!
Released in vite@3.0.0-beta.4

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.

Assets entries in the manifest do not preserve the original file extension
4 participants