Skip to content

Commit d2c81f7

Browse files
authored
fix(legacy): don't lower CSS if legacy chunks are not generated (vitejs#20392)
1 parent ecf5ec1 commit d2c81f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/plugin-legacy/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
209209
config.build = {}
210210
}
211211

212-
if (!config.build.cssTarget) {
212+
if (genLegacy && !config.build.cssTarget) {
213213
// Hint for esbuild that we are targeting legacy browsers when minifying CSS.
214214
// Full CSS compat table available at https://github.com/evanw/esbuild/blob/78e04680228cf989bdd7d471e02bbc2c8d345dc9/internal/compat/css_table.go
215215
// But note that only the `HexRGBA` feature affects the minify outcome.

0 commit comments

Comments
 (0)