@unocss/vite 66.1.0-beta.11 → 66.1.0-beta.12

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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -3
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -341,8 +341,9 @@ function ChunkModeBuildPlugin(ctx) {
341
341
  const tokens = /* @__PURE__ */ new Set();
342
342
  await Promise.all(chunks.map((c) => ctx.uno.applyExtractors(c, void 0, tokens)));
343
343
  const { css } = await ctx.uno.generate(tokens);
344
+ const cssPostTransformHandler = "handler" in cssPlugin.transform ? cssPlugin.transform.handler : cssPlugin.transform;
344
345
  const fakeCssId = `${chunk.fileName}.css`;
345
- await cssPlugin.transform(css, fakeCssId);
346
+ await cssPostTransformHandler.call(this, css, fakeCssId);
346
347
  chunk.modules[fakeCssId] = {
347
348
  code: null,
348
349
  originalLength: 0,
@@ -511,7 +512,9 @@ function GlobalModeBuildPlugin(ctx) {
511
512
  } = await getConfig();
512
513
  if (!cssPlugins.get(dir) || !postcss)
513
514
  return css;
514
- const result = await cssPlugins.get(dir).transform.call(ctx2, css, id);
515
+ const cssPlugin = cssPlugins.get(dir);
516
+ const cssPluginTransformHandler = "handler" in cssPlugin.transform ? cssPlugin.transform.handler : cssPlugin.transform;
517
+ const result = await cssPluginTransformHandler.call(ctx2, css, id);
515
518
  if (!result)
516
519
  return css;
517
520
  if (typeof result === "string")
@@ -653,7 +656,7 @@ function GlobalModeBuildPlugin(ctx) {
653
656
  // here we need to store the resolveId context to use it in the vite:css transform hook
654
657
  resolveContexts.get(layer) || this
655
658
  );
656
- await cssPostTransformHandler.call({}, css, mod);
659
+ await cssPostTransformHandler.call(this, css, mod);
657
660
  }
658
661
  },
659
662
  async buildEnd() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/vite",
3
3
  "type": "module",
4
- "version": "66.1.0-beta.11",
4
+ "version": "66.1.0-beta.12",
5
5
  "description": "The Vite plugin for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -55,9 +55,9 @@
55
55
  "pathe": "^2.0.3",
56
56
  "tinyglobby": "^0.2.12",
57
57
  "unplugin-utils": "^0.2.4",
58
- "@unocss/config": "66.1.0-beta.11",
59
- "@unocss/core": "66.1.0-beta.11",
60
- "@unocss/inspector": "66.1.0-beta.11"
58
+ "@unocss/config": "66.1.0-beta.12",
59
+ "@unocss/core": "66.1.0-beta.12",
60
+ "@unocss/inspector": "66.1.0-beta.12"
61
61
  },
62
62
  "devDependencies": {
63
63
  "vite": "^6.2.6"