From 9f83cdfaa12048eddb177ace4a5efb742a813f4b Mon Sep 17 00:00:00 2001 From: metonym Date: Wed, 18 Sep 2024 14:32:47 -0700 Subject: [PATCH] fix(optimize-css-plugin): convert buffer to string --- src/plugins/OptimizeCssPlugin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/OptimizeCssPlugin.ts b/src/plugins/OptimizeCssPlugin.ts index 6e279ef..1dd1e48 100644 --- a/src/plugins/OptimizeCssPlugin.ts +++ b/src/plugins/OptimizeCssPlugin.ts @@ -54,7 +54,9 @@ class OptimizeCssPlugin { const original_css = assets[id].source(); const optimized_css = createOptimizedCss({ ...this.options, - source: original_css, + source: Buffer.isBuffer(original_css) + ? original_css.toString() + : original_css, ids, });