From 2a4cc96d3a1c4cf609362d5752ea7bd5f029eac3 Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Wed, 2 Apr 2025 10:31:22 +0200 Subject: [PATCH] Add support for async transform function --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index d0c82c9..dcaa966 100644 --- a/src/index.js +++ b/src/index.js @@ -48,10 +48,10 @@ export default (options = {}) => { name: "import-css", /* convert the css file to a module and save the code for a file output */ - transform(code, id) { + async transform(code, id) { if (!filter(id)) return; - const transformedCode = (options.minify) ? minifyCSS(options.transform(code)) : options.transform(code); + const transformedCode = (options.minify) ? minifyCSS(await options.transform(code)) : await options.transform(code); /* cache the result */ if (!styles[id] || styles[id] != transformedCode) {