-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed as not planned
Labels
Description
Describe the bug
Generated JS files that use dynamic imports are not fully minified. For example, when building the reproduction repository, a file dist/assets/index-q-SMFOy6.js
is generated that contains some minified code, followed by the following code that is not minified:
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = []
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
I would have expected that everything in this file is minified, including the __vite__mapDeps
function.
Reproduction
https://github.com/mdickopp/vite-minification-issue
Steps to reproduce
- Clone the reproduction repository
- Change into the cloned directory
- Run
npm install
- Run
npm run build
System Info
System:
OS: Linux 6.5 Debian GNU/Linux trixie/sid
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Memory: 27.93 GB / 31.28 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 18.19.0 - /usr/bin/node
npm: 10.2.5 - ~/.npm/bin/npm
Browsers:
Chromium: 120.0.6099.71
npmPackages:
vite: ^5.0.7 => 5.0.7
Used Package Manager
npm
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 vuejs/core 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.
acid-chicken