-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Dynamic import module build problem #6250
Copy link
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the bug
Dynamic import module cannot seperate source code and dependencies code after build.Inside vite, only the dependencies of non-dynamically imported modules will be packaged into the vendor. But for dynamically imported modules, their dependencies will be packaged with the application code, resulting in a decrease in the cache hit rate.
Reproduction
System Info
System:
OS: macOS 11.2
CPU: (8) arm64 Apple M1
Memory: 141.80 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Browsers:
Chrome: 96.0.4664.110
Safari: 14.0.3
npmPackages:
@vitejs/plugin-react: ^1.0.0 => 1.1.0
vite: ^2.7.6 => 2.7.6Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
