Skip to content

Commit

Permalink
fix(plugin-legacy): use terser as the default minifier (vitejs#5168)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored and aleclarson committed Nov 8, 2021
1 parent f1411bc commit f9ee35c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/playground/legacy/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module.exports = {
],

build: {
// make tests faster
minify: false,

rollupOptions: {
output: {
chunkFileNames(chunkInfo) {
Expand Down
8 changes: 8 additions & 0 deletions packages/plugin-legacy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ function viteLegacyPlugin(options = {}) {
name: 'vite:legacy-generate-polyfill-chunk',
apply: 'build',

config() {
return {
build: {
minify: 'terser'
}
}
},

configResolved(config) {
if (!config.build.ssr && genLegacy && config.build.minify === 'esbuild') {
throw new Error(
Expand Down

0 comments on commit f9ee35c

Please sign in to comment.