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: esbuild glob import resolve error #15140

Merged

Conversation

XiSenao
Copy link
Collaborator

@XiSenao XiSenao commented Nov 25, 2023

Description

fixes #15129

Additional context

Esbuild cannot trigger the onResolve hook in plugins when parsing glob imports, and the current fix is borrowed from https://github.com/vitejs/vite/pull/14533/files#diff-00039b783552b3f2a608918986716e01b1a71996da1a8ad5493a102a1e969d7bR499-R504. But I don't know if any special scenarios are missed.


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, especially the Pull Request Guidelines.
  • 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).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

@XiSenao XiSenao changed the title Fix: esbuild glob import resolve error fix: esbuild glob import resolve error Nov 25, 2023
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

Thanks!

packages/vite/src/node/optimizer/scan.ts Outdated Show resolved Hide resolved
packages/vite/src/node/optimizer/scan.ts Outdated Show resolved Hide resolved
@XiSenao XiSenao requested a review from sapphi-red November 29, 2023 13:07
@patak-dev
Copy link
Member

/ecosystem-ci run

@patak-dev patak-dev added p3-minor-bug An edge case that only affects very specific usage (priority) feat: deps optimizer Esbuild Dependencies Optimization labels Dec 1, 2023
@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on dcdf1ac: Open

suite result latest scheduled
analogjs success success
astro success success
histoire failure failure
ladle success success
laravel failure failure
marko success success
nuxt failure failure
nx success success
previewjs success success
qwik success success
rakkas success success
sveltekit failure failure
unocss success success
vike success success
vite-plugin-pwa success success
vite-plugin-react success success
vite-plugin-react-pages success success
vite-plugin-react-swc success success
vite-plugin-svelte success success
vite-plugin-vue success success
vite-setup-catalogue success success
vitepress success success
vitest success success

@patak-dev patak-dev merged commit 676804d into vitejs:main Dec 1, 2023
10 checks passed
XiSenao added a commit to XiSenao/vite that referenced this pull request Dec 9, 2023
XiSenao added a commit to XiSenao/vite that referenced this pull request Dec 9, 2023
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 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.

No loader is configured for ".svg" files with dynamic import
3 participants