Skip to content

Commit

Permalink
fix race condition issue of postcss-custom-properties #331 (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
malash authored Apr 8, 2022
1 parent 81a4eca commit f0e9099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/postcss-custom-properties/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ const creator: PluginCreator<PluginOptions> = (opts?: PluginOptions) => {
// promise any custom selectors are imported
const customPropertiesPromise = getCustomPropertiesFromImports(importFrom);

let customProperties: Map<string, valuesParser.ParsedValue> = 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<string, valuesParser.ParsedValue> = new Map();

if (canReturnSyncFunction) {
return {
Once: (root) => {
Expand Down

0 comments on commit f0e9099

Please sign in to comment.