@unocss/transformer-attributify-jsx 66.4.0 → 66.4.2
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 +18 -4
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import process from 'node:process';
|
|
2
1
|
import { parse } from '@babel/parser';
|
|
3
|
-
import
|
|
2
|
+
import _traverse from '@babel/traverse';
|
|
4
3
|
import { toArray } from '@unocss/core';
|
|
5
4
|
|
|
5
|
+
function getEnvFlags() {
|
|
6
|
+
const isNode = typeof process !== "undefined" && process.stdout;
|
|
7
|
+
const isVSCode = isNode && !!process.env.VSCODE_CWD;
|
|
8
|
+
const isESLint = isNode && !!process.env.ESLINT;
|
|
9
|
+
return {
|
|
10
|
+
isNode,
|
|
11
|
+
isVSCode,
|
|
12
|
+
isESLint
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const traverse = _traverse.default || _traverse;
|
|
6
17
|
function createFilter(include, exclude) {
|
|
7
18
|
const includePattern = toArray(include || []);
|
|
8
19
|
const excludePattern = toArray(exclude || []);
|
|
@@ -36,8 +47,11 @@ function transformerAttributifyJsx(options = {}) {
|
|
|
36
47
|
enforce: "pre",
|
|
37
48
|
idFilter,
|
|
38
49
|
async transform(code, _, { uno }) {
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
try {
|
|
51
|
+
if (getEnvFlags().isVSCode)
|
|
52
|
+
return;
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
41
55
|
const tasks = [];
|
|
42
56
|
const ast = parse(code.toString(), {
|
|
43
57
|
sourceType: "module",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/transformer-attributify-jsx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.4.
|
|
4
|
+
"version": "66.4.2",
|
|
5
5
|
"description": "Support valueless attributify in JSX/TSX.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/parser": "^7.28.0",
|
|
37
37
|
"@babel/traverse": "^7.28.0",
|
|
38
|
-
"@unocss/core": "66.4.
|
|
38
|
+
"@unocss/core": "66.4.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"magic-string": "^0.30.17"
|