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: allow tree-shake glob eager css in js #9547

Merged
merged 2 commits into from
Aug 8, 2022

Conversation

sapphi-red
Copy link
Member

Description

Make it possible to tree-shake the value when all value of glob-eager are not used.

close #9537

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 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.

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Aug 5, 2022
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

This is an interesting effect of #3682. I wonder if there is a better way to avoid Object.assign now that you found out we also need __PURE__ for it. For now, let's merge this, I consider it a fix more than a feat.

@patak-dev patak-dev changed the title feat: tree-shake glob eager css in js fix: allow tree-shake glob eager css in js Aug 8, 2022
@patak-dev patak-dev merged commit 2e309d6 into vitejs:main Aug 8, 2022
@sapphi-red sapphi-red deleted the feat/glob-eager-css-tree-shake branch August 9, 2022 02:52
@ermolaev ermolaev mentioned this pull request Aug 9, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import.meta.glob for css, injected css to production js bundle
2 participants