@unocss/webpack 0.61.2 → 0.61.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -69,9 +69,10 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
69
69
  const tokens = /* @__PURE__ */ new Set();
70
70
  const tasks = [];
71
71
  const affectedModules = /* @__PURE__ */ new Set();
72
+ const loadConfig = config.createRecoveryConfigLoader();
72
73
  let ready = reloadConfig();
73
74
  async function reloadConfig() {
74
- const result = await config.loadConfig(root, configOrPath, extraConfigSources, defaults);
75
+ const result = await loadConfig(root, configOrPath, extraConfigSources, defaults);
75
76
  resolveConfigResult(result);
76
77
  deprecationCheck(result.config);
77
78
  rawConfig = result.config;
@@ -131,7 +132,8 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
131
132
  async function flushTasks() {
132
133
  const _tasks = [...tasks];
133
134
  await Promise.all(_tasks);
134
- tasks.splice(0, _tasks.length);
135
+ if (tasks[0] === _tasks[0])
136
+ tasks.splice(0, _tasks.length);
135
137
  }
136
138
  return {
137
139
  get ready() {
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { resolve, isAbsolute, normalize } from 'node:path';
3
3
  import { createUnplugin } from 'unplugin';
4
4
  import WebpackSources from 'webpack-sources';
5
5
  import { createFilter } from '@rollup/pluginutils';
6
- import { loadConfig } from '@unocss/config';
6
+ import { createRecoveryConfigLoader } from '@unocss/config';
7
7
  import { cssIdRE, createGenerator, BetterMap } from '@unocss/core';
8
8
  import fs from 'node:fs/promises';
9
9
  import fg from 'fast-glob';
@@ -56,6 +56,7 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
56
56
  const tokens = /* @__PURE__ */ new Set();
57
57
  const tasks = [];
58
58
  const affectedModules = /* @__PURE__ */ new Set();
59
+ const loadConfig = createRecoveryConfigLoader();
59
60
  let ready = reloadConfig();
60
61
  async function reloadConfig() {
61
62
  const result = await loadConfig(root, configOrPath, extraConfigSources, defaults);
@@ -118,7 +119,8 @@ function createContext(configOrPath, defaults = {}, extraConfigSources = [], res
118
119
  async function flushTasks() {
119
120
  const _tasks = [...tasks];
120
121
  await Promise.all(_tasks);
121
- tasks.splice(0, _tasks.length);
122
+ if (tasks[0] === _tasks[0])
123
+ tasks.splice(0, _tasks.length);
122
124
  }
123
125
  return {
124
126
  get ready() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/webpack",
3
3
  "type": "module",
4
- "version": "0.61.2",
4
+ "version": "0.61.4",
5
5
  "description": "The Webpack plugin for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -47,15 +47,15 @@
47
47
  "chokidar": "^3.6.0",
48
48
  "fast-glob": "^3.3.2",
49
49
  "magic-string": "^0.30.10",
50
- "unplugin": "^1.10.1",
50
+ "unplugin": "^1.11.0",
51
51
  "webpack-sources": "^3.2.3",
52
- "@unocss/config": "0.61.2",
53
- "@unocss/core": "0.61.2"
52
+ "@unocss/config": "0.61.4",
53
+ "@unocss/core": "0.61.4"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/webpack": "^5.28.5",
57
57
  "@types/webpack-sources": "^3.2.3",
58
- "webpack": "^5.92.0"
58
+ "webpack": "^5.93.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "unbuild",