Skip to content

Commit

Permalink
fix(plugin-legacy): use terser as the default minifier (#5168)
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored Oct 1, 2021
1 parent c5bfc5e commit 9ee7234
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 9ee7234

Please sign in to comment.