Skip to content

Commit f0e9099

Browse files
authored
fix race condition issue of postcss-custom-properties #331 (#332)
1 parent 81a4eca commit f0e9099

File tree

1 file changed

+2
-2
lines changed
  • plugins/postcss-custom-properties/src

1 file changed

+2
-2
lines changed

plugins/postcss-custom-properties/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ const creator: PluginCreator<PluginOptions> = (opts?: PluginOptions) => {
4848
// promise any custom selectors are imported
4949
const customPropertiesPromise = getCustomPropertiesFromImports(importFrom);
5050

51-
let customProperties: Map<string, valuesParser.ParsedValue> = new Map();
52-
5351
// whether to return synchronous function if no asynchronous operations are requested
5452
const canReturnSyncFunction = importFrom.length === 0 && exportTo.length === 0;
5553

5654
return {
5755
postcssPlugin: 'postcss-custom-properties',
5856
prepare () {
57+
let customProperties: Map<string, valuesParser.ParsedValue> = new Map();
58+
5959
if (canReturnSyncFunction) {
6060
return {
6161
Once: (root) => {

0 commit comments

Comments
 (0)