You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't really consider this a bug, since it matches what matches the glob. The idea is you should only use glob patterns that are specific and ideally in a nested src directory.
Describe the bug
Similarly to #1974 (Ignore
node_modules/
when runningimport.meta.glob
),import.meta.glob
searches insidedist/
.This is problematic because:
$ vite build
run generates files indist/
.$ vite build
run includes files insidedist/
of the previous build.$ vite build
run includes files of both the second and the first build.This leads
dist/
to grow indefinitely after eachvite build
. This also leads to recursively growing bundle sizes.Simply adding
config.build.outDir
tofast-glob
'signore
is not sufficient. For example, following builds don't know each other'sconfig.build.outDir
:$ vite build --ssrManifest --outDir dist/client
$ vite build --ssr src/entry-server.js --outDir dist/server
For the same reason, removing
dist/
before$ vite build
isn't a solution either.Instead, I'm proposing the more drastic but also more powerful solution #1986 - Programmatic definition of entries (alternatively to
import.meta.glob
).(The rest of the bug template is not applicable.)
The text was updated successfully, but these errors were encountered: