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

feat(optimizer): support glob includes #12414

Merged
merged 6 commits into from
Jun 7, 2023
Merged

feat(optimizer): support glob includes #12414

merged 6 commits into from
Jun 7, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Mar 14, 2023

Description

Close #5419

Support optimizeDeps.include: ['some-pkg/**/*', 'another-pkg/*.js', ...] syntax. While the user could glob themselves, this PR also handles the complex logic of globbing packages with exports.

Besides the issue above, I had found in Svelte land where this could be useful for component libraries that heavily rely on deep imports. Being able to optimize all deep imports at once would be helpful.

Additional context

The test could be a lot more complete, but it got a minimum to start with


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 Mar 14, 2023

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

@patak-dev patak-dev added p2-nice-to-have Not breaking anything but nice to have (priority) feat: deps optimizer Esbuild Dependencies Optimization labels Mar 14, 2023
@patak-dev
Copy link
Member

Nice! Looks good to me. Added the PR to the team board with P2-5 so we get to it in the next meeting.

@patak-dev patak-dev added this to the 4.3 milestone Mar 14, 2023
Liknox
Liknox previously approved these changes Mar 17, 2023
@bluwy
Copy link
Member Author

bluwy commented Apr 8, 2023

Added docs and mention that it's experimental. Should be good now.

patak-dev
patak-dev previously approved these changes Jun 6, 2023
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.

Feel free to merge this one after resolving the conflicts @bluwy

@bluwy
Copy link
Member Author

bluwy commented Jun 7, 2023

The CI fail seems to be flaky and unrelated as it happens for other PRs too. It likely happen more often since #13413 (even though the PR is a good refactor).

I'm thinking we could merge this for now and tackle that separately (which I'm checking now). Alas I can't merge without an approving review 😅

@patak-dev patak-dev merged commit 7792515 into main Jun 7, 2023
@patak-dev patak-dev deleted the glob-include branch June 7, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: deps optimizer Esbuild Dependencies Optimization p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Glob support in optimizeDeps.include
3 participants