@unocss/postcss 66.6.8 → 66.7.0-beta.1
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/esm.mjs +5 -6
- package/dist/index.cjs +1 -2
- package/dist/index.mjs +1 -2
- package/package.json +5 -8
package/dist/esm.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFile, stat } from "node:fs/promises";
|
|
2
2
|
import { normalize } from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
|
-
import { createGenerator, expandVariantGroup, notNull, regexScopePlaceholder } from "@unocss/core";
|
|
5
4
|
import { createRecoveryConfigLoader } from "@unocss/config";
|
|
5
|
+
import { createGenerator, expandVariantGroup, notNull, regexScopePlaceholder } from "@unocss/core";
|
|
6
6
|
import { calcMaxWidthBySize, hasThemeFn, transformThemeFn } from "@unocss/rule-utils";
|
|
7
7
|
import postcss from "postcss";
|
|
8
8
|
import { glob } from "tinyglobby";
|
|
@@ -28,7 +28,7 @@ async function parseApply(root, uno, directiveName) {
|
|
|
28
28
|
const parentAfterNodes = [];
|
|
29
29
|
for (const i of utils) {
|
|
30
30
|
const [, _selector, body, parent] = i;
|
|
31
|
-
const selector =
|
|
31
|
+
const selector = _selector?.replace(regexScopePlaceholder, " ") || _selector;
|
|
32
32
|
if (parent || selector && selector !== ".\\-" && !selector.startsWith("@property")) {
|
|
33
33
|
const node = parse(rule.parent.toString(), { context: "rule" });
|
|
34
34
|
let newSelector = generate(node.prelude);
|
|
@@ -131,8 +131,7 @@ function createPlugin(options) {
|
|
|
131
131
|
let last_config_mtime = 0;
|
|
132
132
|
const targetRE = new RegExp(Object.values(directiveMap).join("|"));
|
|
133
133
|
return async function plugin(root, result) {
|
|
134
|
-
|
|
135
|
-
const from = (_result$opts$from = result.opts.from) === null || _result$opts$from === void 0 ? void 0 : _result$opts$from.split("?")[0];
|
|
134
|
+
const from = result.opts.from?.split("?")[0];
|
|
136
135
|
if (!from) return;
|
|
137
136
|
let isTarget = targetCache.has(from);
|
|
138
137
|
const isScanTarget = root.toString().includes(`@${directiveMap.unocss}`);
|
|
@@ -165,9 +164,9 @@ function createPlugin(options) {
|
|
|
165
164
|
} catch (error) {
|
|
166
165
|
throw new Error(`UnoCSS config not found: ${error.message}`);
|
|
167
166
|
}
|
|
168
|
-
const globs =
|
|
167
|
+
const globs = uno.config.content?.filesystem ?? defaultFilesystemGlobs;
|
|
169
168
|
const needCheckNodeMoudules = globs.some((i) => i.includes("node_modules"));
|
|
170
|
-
const plainContent =
|
|
169
|
+
const plainContent = uno.config.content?.inline ?? [];
|
|
171
170
|
const entries = await glob(isScanTarget ? globs : [from], {
|
|
172
171
|
cwd,
|
|
173
172
|
absolute: true,
|
package/dist/index.cjs
CHANGED
|
@@ -4,10 +4,9 @@ Object.defineProperties(exports, {
|
|
|
4
4
|
});
|
|
5
5
|
//#region src/index.ts
|
|
6
6
|
function unocss(options = {}) {
|
|
7
|
-
var _options$directiveMap;
|
|
8
7
|
let promise;
|
|
9
8
|
return {
|
|
10
|
-
postcssPlugin:
|
|
9
|
+
postcssPlugin: options.directiveMap?.unocss || "unocss",
|
|
11
10
|
plugins: [async (root, result) => {
|
|
12
11
|
if (!promise) promise = import("@unocss/postcss/esm").then((r) => r.createPlugin(options));
|
|
13
12
|
return await (await promise)(root, result);
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
//#region src/index.ts
|
|
2
2
|
function unocss(options = {}) {
|
|
3
|
-
var _options$directiveMap;
|
|
4
3
|
let promise;
|
|
5
4
|
return {
|
|
6
|
-
postcssPlugin:
|
|
5
|
+
postcssPlugin: options.directiveMap?.unocss || "unocss",
|
|
7
6
|
plugins: [async (root, result) => {
|
|
8
7
|
if (!promise) promise = import("@unocss/postcss/esm").then((r) => r.createPlugin(options));
|
|
9
8
|
return await (await promise)(root, result);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/postcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.
|
|
4
|
+
"version": "66.7.0-beta.1",
|
|
5
5
|
"description": "PostCSS plugin for UnoCSS",
|
|
6
6
|
"author": "sibbng <sibbngheid@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -40,19 +40,16 @@
|
|
|
40
40
|
"files": [
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=14"
|
|
45
|
-
},
|
|
46
43
|
"peerDependencies": {
|
|
47
44
|
"postcss": "^8.4.21"
|
|
48
45
|
},
|
|
49
46
|
"dependencies": {
|
|
50
47
|
"css-tree": "^3.2.1",
|
|
51
|
-
"postcss": "^8.5.
|
|
48
|
+
"postcss": "^8.5.14",
|
|
52
49
|
"tinyglobby": "^0.2.16",
|
|
53
|
-
"@unocss/config": "66.
|
|
54
|
-
"@unocss/
|
|
55
|
-
"@unocss/
|
|
50
|
+
"@unocss/config": "66.7.0-beta.1",
|
|
51
|
+
"@unocss/rule-utils": "66.7.0-beta.1",
|
|
52
|
+
"@unocss/core": "66.7.0-beta.1"
|
|
56
53
|
},
|
|
57
54
|
"scripts": {
|
|
58
55
|
"build": "tsdown --config-loader unrun",
|