Fix broken CSS due to bug in Cloudflare minifier

This commit is contained in:
Keavon Chambers 2023-12-07 14:34:21 -08:00
parent 165c747d62
commit b7e304a708
1 changed files with 5 additions and 0 deletions

View File

@ -71,6 +71,11 @@ export default defineConfig({
},
}),
],
output: {
// Inject `.min` into the filename of minified CSS files to tell Cloudflare not to minify it again.
// Cloudflare's minifier breaks the CSS due to a bug where it removes whitespace around calc() plus operators.
assetFileNames: (info) => `assets/[name]-[hash]${info.name?.endsWith(".css") ? ".min" : ""}[extname]`,
},
},
},
});