From 6c0f45d59d98b2e1e3b7dd682b65ce666799e5a0 Mon Sep 17 00:00:00 2001 From: Philipp Weitershausen Date: Wed, 13 Dec 2023 10:04:26 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#67882=20postcss-ur?= =?UTF-8?q?l=20CustomTransformFunction=20can=20be=20async=20by=20@philikon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Philipp Weitershausen --- types/postcss-url/index.d.ts | 2 +- types/postcss-url/postcss-url-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/postcss-url/index.d.ts b/types/postcss-url/index.d.ts index 78d5b2b5f52e9f..89035f6597ff36 100644 --- a/types/postcss-url/index.d.ts +++ b/types/postcss-url/index.d.ts @@ -51,7 +51,7 @@ declare namespace url { */ file?: string | undefined; }, - ) => string; + ) => string | Promise; type CustomHashFunction = (file: Buffer) => string; type CustomFilterFunction = (file: string) => boolean; diff --git a/types/postcss-url/postcss-url-tests.ts b/types/postcss-url/postcss-url-tests.ts index 399446817c643a..b0efb0710ef50b 100644 --- a/types/postcss-url/postcss-url-tests.ts +++ b/types/postcss-url/postcss-url-tests.ts @@ -13,3 +13,7 @@ postcss().use( { filter: "cdn/**/*", url: asset => `https://cdn.url/${asset.url}` }, ]), ); + +postcss().use(url({ url: (asset) => asset.url })); + +postcss().use(url({ url: async (asset) => asset.url }));