Skip to content

Commit 4005a83

Browse files
committed
chore: bump version
1 parent e65f146 commit 4005a83

File tree

7 files changed

+984
-905
lines changed

7 files changed

+984
-905
lines changed

.changeset/five-steaks-own.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tailwindcss-patch": patch
3+
---
4+
5+
feat: use jiti instead of tsx

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,24 @@
5454
"@types/html-minifier-terser": "^7.0.2",
5555
"@types/klaw": "^3.0.6",
5656
"@types/lint-staged": "^13.3.0",
57-
"@types/lodash": "^4.17.12",
57+
"@types/lodash": "^4.17.13",
5858
"@types/lodash-es": "^4.17.12",
5959
"@types/micromatch": "^4.0.9",
60-
"@types/node": "^22.8.1",
60+
"@types/node": "^22.8.6",
6161
"@types/resolve": "^1.20.6",
6262
"@types/semver": "^7.5.8",
6363
"@types/set-value": "^4.0.3",
6464
"@vitest/coverage-v8": "~2.1.4",
65-
"astro": "^4.16.7",
65+
"astro": "^4.16.8",
6666
"ci-info": "^4.0.0",
6767
"comment-json": "^4.2.5",
6868
"cross-env": "^7.0.3",
6969
"css-loader": "^7.1.2",
7070
"dedent": "^1.5.3",
7171
"defu": "^6.1.4",
7272
"del": "^8.0.0",
73-
"eslint": "^9.13.0",
74-
"execa": "^9.5.0",
73+
"eslint": "^9.14.0",
74+
"execa": "^9.5.1",
7575
"fast-glob": "^3.3.2",
7676
"fs-extra": "^11.2.0",
7777
"get-value": "^3.0.1",
@@ -84,7 +84,7 @@
8484
"lodash": "^4.17.21",
8585
"lodash-es": "^4.17.21",
8686
"micromatch": "^4.0.8",
87-
"mini-css-extract-plugin": "^2.9.1",
87+
"mini-css-extract-plugin": "^2.9.2",
8888
"normalize-newline": "^4.1.0",
8989
"only-allow": "^1.2.1",
9090
"pathe": "^1.1.2",
@@ -94,12 +94,12 @@
9494
"postcss7": "npm:postcss@7",
9595
"prettier": "^3.3.3",
9696
"rimraf": "^6.0.1",
97-
"rollup": "^4.24.2",
97+
"rollup": "^4.24.3",
9898
"set-value": "^4.1.0",
9999
"tailwindcss": "^3.4.14",
100100
"tailwindcss-patch": "workspace:*",
101101
"tailwindcss2": "npm:@tailwindcss/postcss7-compat@^2.2.17",
102-
"tslib": "^2.8.0",
102+
"tslib": "^2.8.1",
103103
"tsup": "^8.3.5",
104104
"tsx": "^4.19.2",
105105
"turbo": "^2.2.1",
@@ -110,7 +110,7 @@
110110
"vite": "^5.4.10",
111111
"vite-tsconfig-paths": "^5.0.1",
112112
"vitest": "~2.1.4",
113-
"webpack": "^5.95.0",
113+
"webpack": "^5.96.1",
114114
"webpack-build-utils": "^0.0.7",
115115
"yaml": "^2.6.0"
116116
}

packages/core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
"dependencies": {
6666
"@ast-core/escape": "^1.0.1",
67-
"@babel/parser": "^7.26.1",
67+
"@babel/parser": "^7.26.2",
6868
"@babel/traverse": "^7.25.9",
6969
"@babel/types": "^7.26.0",
7070
"@tailwindcss-mangle/config": "workspace:^",

packages/tailwindcss-patch/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,19 @@
7272
}
7373
},
7474
"dependencies": {
75-
"@babel/generator": "^7.26.0",
76-
"@babel/parser": "^7.26.1",
75+
"@babel/generator": "^7.26.2",
76+
"@babel/parser": "^7.26.2",
7777
"@babel/traverse": "^7.25.9",
7878
"@babel/types": "^7.26.0",
7979
"@tailwindcss-mangle/config": "workspace:^",
8080
"cac": "^6.7.14",
8181
"consola": "^3.2.3",
8282
"fs-extra": "^11.2.0",
83+
"jiti": "^2.4.0",
8384
"lilconfig": "^3.1.2",
8485
"pathe": "^1.1.2",
8586
"postcss": "^8.4.47",
8687
"resolve": "^1.22.8",
87-
"semver": "^7.6.3",
88-
"tsx": "^4.19.2"
88+
"semver": "^7.6.3"
8989
}
9090
}

packages/tailwindcss-patch/src/core/postcss.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { createRequire } from 'node:module'
22
import process from 'node:process'
33
import { defu } from '@tailwindcss-mangle/shared'
4+
import { createJiti } from 'jiti'
45
import { lilconfig } from 'lilconfig'
56
import path from 'pathe'
67
import postcss from 'postcss'
78
import { requireResolve } from '../utils'
89

10+
const jiti = createJiti(import.meta.url)
911
const require = createRequire(import.meta.url)
1012
export interface ProcessTailwindcssOptions {
1113
cwd?: string
@@ -20,7 +22,7 @@ export async function processTailwindcss(options: ProcessTailwindcssOptions) {
2022
// 没有具体指定的话,就走下面的分支
2123
if (!(typeof config === 'string' && path.isAbsolute(config))) {
2224
const moduleName = 'tailwind'
23-
const tsx = (await import('tsx/cjs/api')).require
25+
2426
const result = await lilconfig('tailwindcss', {
2527
searchPlaces: [
2628
`${moduleName}.config.js`,
@@ -32,12 +34,12 @@ export async function processTailwindcss(options: ProcessTailwindcssOptions) {
3234
],
3335
loaders: {
3436
// 默认支持 js 和 cjs 2种格式
35-
'.js': tsx,
36-
'.cjs': tsx,
37-
'.mjs': tsx,
38-
'.ts': tsx,
39-
'.cts': tsx,
40-
'.mts': tsx,
37+
'.js': jiti,
38+
'.cjs': jiti,
39+
'.mjs': jiti,
40+
'.ts': jiti,
41+
'.cts': jiti,
42+
'.mts': jiti,
4143
},
4244
}).search(cwd)
4345
if (!result) {

0 commit comments

Comments
 (0)