@unocss/vite 65.4.2 → 65.5.0
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.mjs +9 -9
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import process$1 from 'node:process';
|
|
2
|
-
import { createFilter } from '@rollup/pluginutils';
|
|
3
2
|
import { createRecoveryConfigLoader } from '@unocss/config';
|
|
4
3
|
import { cssIdRE, createGenerator, BetterMap, toEscapedSelector, LAYER_IMPORTS, LAYER_PREFLIGHTS, notNull } from '@unocss/core';
|
|
4
|
+
import { createFilter } from 'unplugin-utils';
|
|
5
5
|
import UnocssInspector from '@unocss/inspector';
|
|
6
6
|
import fs from 'node:fs';
|
|
7
|
-
import {
|
|
7
|
+
import { resolve, dirname, isAbsolute } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import fs$1 from 'node:fs/promises';
|
|
10
10
|
import { glob } from 'tinyglobby';
|
|
@@ -332,7 +332,7 @@ function ChunkModeBuildPlugin(ctx) {
|
|
|
332
332
|
return null;
|
|
333
333
|
await ctx.ready;
|
|
334
334
|
const tokens = /* @__PURE__ */ new Set();
|
|
335
|
-
await Promise.all(chunks.map((c) => ctx.uno.applyExtractors(c,
|
|
335
|
+
await Promise.all(chunks.map((c) => ctx.uno.applyExtractors(c, void 0, tokens)));
|
|
336
336
|
const { css } = await ctx.uno.generate(tokens);
|
|
337
337
|
const fakeCssId = `${chunk.fileName}.css`;
|
|
338
338
|
await cssPlugin.transform(css, fakeCssId);
|
|
@@ -569,7 +569,7 @@ function GlobalModeBuildPlugin(ctx) {
|
|
|
569
569
|
vfsLayers.clear();
|
|
570
570
|
tasks.length = 0;
|
|
571
571
|
lastTokenSize = 0;
|
|
572
|
-
lastResult =
|
|
572
|
+
lastResult = void 0;
|
|
573
573
|
},
|
|
574
574
|
transform(code, id) {
|
|
575
575
|
if (filter(code, id))
|
|
@@ -707,7 +707,7 @@ function GlobalModeBuildPlugin(ctx) {
|
|
|
707
707
|
const layerEnd = `#--unocss-layer-end--${layer}--{end:${layer}}`;
|
|
708
708
|
let layerContent;
|
|
709
709
|
if (layer === LAYER_MARK_ALL) {
|
|
710
|
-
layerContent = result.getLayers(
|
|
710
|
+
layerContent = result.getLayers(void 0, [...vfsLayers, LAYER_IMPORTS]);
|
|
711
711
|
} else {
|
|
712
712
|
layerContent = result.getLayer(layer) || "";
|
|
713
713
|
}
|
|
@@ -803,7 +803,7 @@ function GlobalModeDevPlugin(ctx) {
|
|
|
803
803
|
break;
|
|
804
804
|
tokensSize = tokens.size;
|
|
805
805
|
} while (true);
|
|
806
|
-
const css = layer === LAYER_MARK_ALL ? result.getLayers(
|
|
806
|
+
const css = layer === LAYER_MARK_ALL ? result.getLayers(void 0, Array.from(entries).map((i) => resolveLayer(i)).filter((i) => !!i)) : result.getLayer(layer);
|
|
807
807
|
const hash = getHash(css || "", HASH_LENGTH);
|
|
808
808
|
lastServedHash.set(layer, hash);
|
|
809
809
|
lastServedTime = Date.now();
|
|
@@ -860,7 +860,7 @@ function GlobalModeDevPlugin(ctx) {
|
|
|
860
860
|
function clearWarnTimer() {
|
|
861
861
|
if (resolvedWarnTimer) {
|
|
862
862
|
clearTimeout(resolvedWarnTimer);
|
|
863
|
-
resolvedWarnTimer =
|
|
863
|
+
resolvedWarnTimer = void 0;
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
onInvalidate(() => {
|
|
@@ -1023,7 +1023,7 @@ function PerModuleModePlugin(ctx) {
|
|
|
1023
1023
|
return;
|
|
1024
1024
|
const hash = getHash(id);
|
|
1025
1025
|
const hasScope = SCOPE_IMPORT_RE.test(code);
|
|
1026
|
-
const { css } = await ctx.uno.generate(code, { id, scope: hasScope ? `.${hash}` :
|
|
1026
|
+
const { css } = await ctx.uno.generate(code, { id, scope: hasScope ? `.${hash}` : void 0, preflights: false });
|
|
1027
1027
|
if (!css && !hasScope)
|
|
1028
1028
|
return null;
|
|
1029
1029
|
if (hasScope)
|
|
@@ -1223,7 +1223,7 @@ function VueScopedPlugin(ctx) {
|
|
|
1223
1223
|
function createTransformerPlugins(ctx) {
|
|
1224
1224
|
const orders = ["default", "pre", "post"];
|
|
1225
1225
|
return orders.map((_order) => {
|
|
1226
|
-
const order = _order === "default" ?
|
|
1226
|
+
const order = _order === "default" ? void 0 : _order;
|
|
1227
1227
|
const htmlHandler = (code) => {
|
|
1228
1228
|
return applyTransformers(ctx, code, "index.html", order).then((t) => t?.code);
|
|
1229
1229
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "65.
|
|
4
|
+
"version": "65.5.0",
|
|
5
5
|
"description": "The Vite plugin for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"homepage": "https://unocss.dev",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
|
-
"url": "https://github.com/unocss/unocss",
|
|
12
|
+
"url": "git+https://github.com/unocss/unocss",
|
|
13
13
|
"directory": "packages-integrations/vite"
|
|
14
14
|
},
|
|
15
15
|
"bugs": {
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@ampproject/remapping": "^2.3.0",
|
|
53
|
-
"@rollup/pluginutils": "^5.1.4",
|
|
54
53
|
"chokidar": "^3.6.0",
|
|
55
54
|
"magic-string": "^0.30.17",
|
|
56
55
|
"tinyglobby": "^0.2.10",
|
|
57
|
-
"
|
|
58
|
-
"@unocss/
|
|
59
|
-
"@unocss/inspector": "65.
|
|
56
|
+
"unplugin-utils": "^0.2.4",
|
|
57
|
+
"@unocss/config": "65.5.0",
|
|
58
|
+
"@unocss/inspector": "65.5.0",
|
|
59
|
+
"@unocss/core": "65.5.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"vite": "^6.0
|
|
62
|
+
"vite": "^6.1.0"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"build": "unbuild",
|