fix(browser): don't exclude node builtins from optimization#5082
fix(browser): don't exclude node builtins from optimization#5082sheremet-va merged 4 commits intovitest-dev:mainfrom
Conversation
✅ Deploy Preview for fastidious-cascaron-4ded94 canceled.
|
| } | ||
| }, | ||
| transform(code, id) { | ||
| if (id.includes('loupe/loupe.js')) { |
There was a problem hiding this comment.
We can just bundle loupe to be honest, but then we should probably bundle chai, but I don't see that happening 🤷🏻
There was a problem hiding this comment.
Just in case, can you clarify the issues with bundling chai?
I guess the obvious one is that it affects vitest's package size. Another one I thought about is that a user code relying on import "chai" would end up with different instance of chai from what Vitest sees internally.
Do you have anything else in mind?
|
@hi-ogawa what do you think? We don't want Vite to bundle it because it adds an import from |
|
Oh, I wasn't aware that node builtins were in From this comment #4892 (comment), I thought we could simply add
What do you mean by it adds |
We probably forgot to remove it when we provided polyfills ourselves.
It transforms |
Description
Fixes #4535
Fixes #4892
Possibly fixes #5046
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yamlunless you introduce a new test example.Tests
pnpm test:ci.Documentation
pnpm run docscommand.Changesets
feat:,fix:,perf:,docs:, orchore:.