vite icon indicating copy to clipboard operation
vite copied to clipboard

Failed to resolve workspace dependency present in 'optimizeDeps.include'

Open tajo opened this issue 3 years ago • 0 comments

Describe the bug

It seems that optimizeDeps.include is able to resolve only dependencies that are defined in the root workspace and its package.json. In other words, you can optimize deps only from a single workspace.

After opening the repro, you will see this warning:

Failed to resolve dependency: jquery, present in 'optimizeDeps.include'

while react gets optimized just fine because it's in the root workspace.

Expectation

optimizeDeps.include should work for all dependencies across multiple workspaces. If these deps can be later resolved and served by Vite anyway I don't see a reason why they couldn't be prebundled as well.

Reproduction

https://stackblitz.com/edit/node-whfueq?file=app%2Fpackage.json

System Info

Stackblitz

Used Package Manager

pnpm

Logs

No response

Validations

tajo avatar Sep 09 '22 00:09 tajo