-
-
Notifications
You must be signed in to change notification settings - Fork 177
Description
Related
- Improve
optimizeDeps.exclude
suggestion warning #736 - fix(rsc): include non-entry optimized modules for
optimizeDeps.exclude
suggestion #740
I thought It's pretty accurate now but technically it causes a false positive when users are optimizing aggressively with optimizeDeps.entries
, which picks up server libraries. Even though browser will only load "non optimized" version of modules, "optimized" version of modules can end up in .vite/deps
, which triggers a warning.
For example, Waku uses all server routes as optimizeDeps.enties
and waku-jotai/router
is imported in one of a page https://github.com/wakujs/waku/blob/e100dab9915946f64c436e01917a88aac675d13b/e2e/fixtures/waku-jotai/src/pages/index.tsx#L3. Then browser optimizer will pick up and optimize waku-jotai/router
, which end up bundling waku-jotai/dist/router/client.js
while what browser actually loads is only non-optimized waku-jotai/dist/router/client.js
.
To avoid this, we might need to detect .vite/deps
files are actually requested via transform
hook.