diff --git a/plugins/postcss-custom-properties/src/index.ts b/plugins/postcss-custom-properties/src/index.ts index c5076a4e6..22b2f1187 100755 --- a/plugins/postcss-custom-properties/src/index.ts +++ b/plugins/postcss-custom-properties/src/index.ts @@ -48,14 +48,14 @@ const creator: PluginCreator = (opts?: PluginOptions) => { // promise any custom selectors are imported const customPropertiesPromise = getCustomPropertiesFromImports(importFrom); - let customProperties: Map = new Map(); - // whether to return synchronous function if no asynchronous operations are requested const canReturnSyncFunction = importFrom.length === 0 && exportTo.length === 0; return { postcssPlugin: 'postcss-custom-properties', prepare () { + let customProperties: Map = new Map(); + if (canReturnSyncFunction) { return { Once: (root) => {