Skip to content

feat(optimizer): support glob includes#12414

Merged
patak-cat merged 6 commits intomainfrom
glob-include
Jun 7, 2023
Merged

feat(optimizer): support glob includes#12414
patak-cat merged 6 commits intomainfrom
glob-include

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.

@bolt-new-by-stackblitz
Copy link

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

@patak-cat patak-cat added p2-nice-to-have Not breaking anything but nice to have (priority) feat: deps optimizer Esbuild Dependencies Optimization labels Mar 14, 2023
@patak-cat
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-cat patak-cat 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-cat
patak-cat previously approved these changes Jun 6, 2023
Copy link
Member

@patak-cat patak-cat 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-cat patak-cat merged commit 7792515 into main Jun 7, 2023
@patak-cat patak-cat 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