forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(plugin-legacy): don't force terser on non-legacy (fix vitejs#6266)
This fixes two misbehaviors of the legacy plugin: 1. Respect {minify: false} for legacy assets. 2. Don't inflict es2019/terser on non-legacy chunks. For the first problem, we could have fixed by checking for false in viteLegacyPlugin.config(). Unfortunately that would have left the second problem unsolved. Without adding significant complexity to the config, there's no easy way to use different minifiers in the build depending on the individual chunk. So instead we include terserPlugin() whenever minify is enabled, even true or 'esbuild', then check the actual configuration in the plugin. This allows the legacy plugin to inject its special override, leaving all the non-legacy stuff intact and uncomplicated. See also, previous attempts: vitejs#5157 vitejs#5168
- Loading branch information
Showing
5 changed files
with
39 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,6 @@ | |
"systemjs": "^6.11.0" | ||
}, | ||
"peerDependencies": { | ||
"vite": "^2.0.0" | ||
"vite": "^2.7.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters