-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Description
We have noticed that Vite does not work properly with the Rushjs monorepo tool because it uses a unique pnpm store that moves the pnpm-lock.yaml file into a non standard, but shared location across the monorepo.
The dependency optimizer code currently assumes a location for the lock file, and this location is not configurable. If the lock file is not found then the hash is computed based on an empty string, so the dependency optimizer never changes the cache. This results in many failed builds making vite unusable, especially as disabling the optimizer also makes it hard to use commonjs modules.
https://github.com/vitejs/vite/blob/main/packages/vite/src/node/optimizer/index.ts#L1294
Suggest you add a configuration property to specify the location and format of the lockfile, this would then make vite usable with a variety of monorepo tools.
Suggested solution
Add a lockFilePath
configuration property to specify the location of lock file used by the dependency optimizer.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.