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

Transitive dependencies can't be excluded from pre-bundling #2357

Closed
3 tasks done
kaksmet opened this issue Mar 3, 2021 · 1 comment
Closed
3 tasks done

Transitive dependencies can't be excluded from pre-bundling #2357

kaksmet opened this issue Mar 3, 2021 · 1 comment

Comments

@kaksmet
Copy link

kaksmet commented Mar 3, 2021

⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.

Describe the bug

Transitive dependencies can't be excluded from pre-bundling.
The optimizeDeps.exclude option only seems to work for direct dependencies.

I'm trying to achieve something like rollup's output.globals for vite.
I have written a vite plugin that does this, but it does not work for transitive dependencies since they have already been pre-bundled and therefore the plugin's resolveId is never invoked for them. (even though they are included in optimizeDeps.exclude)

System Info

  • vite version: 2.0.4
  • Operating System: Windows
  • Node version: 14.16.0
  • Package manager (npm/yarn/pnpm) and version: npm 6.14.11
@bluwy
Copy link
Member

bluwy commented Mar 5, 2022

Looks like this is the same as #5688. Though this was created earlier, there was more discussion in that issue, so I'll close this in favour of that. Thanks for bringing this up!

@bluwy bluwy closed this as completed Mar 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants