tailwindcss-patch 5.0.1 → 5.0.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.
@@ -748,9 +748,11 @@ function isObject(val) {
748
748
  // src/core/postcss.ts
749
749
  import { createRequire as createRequire2 } from "node:module";
750
750
  import process3 from "node:process";
751
+ import { createJiti } from "jiti";
751
752
  import { lilconfig } from "lilconfig";
752
753
  import path6 from "pathe";
753
754
  import postcss from "postcss";
755
+ var jiti = createJiti(import.meta.url);
754
756
  var require3 = createRequire2(import.meta.url);
755
757
  async function processTailwindcss(options) {
756
758
  const { config: userConfig, cwd } = defu(options, {
@@ -759,7 +761,6 @@ async function processTailwindcss(options) {
759
761
  let config = userConfig;
760
762
  if (!(typeof config === "string" && path6.isAbsolute(config))) {
761
763
  const moduleName = "tailwind";
762
- const tsx = (await import("tsx/cjs/api")).require;
763
764
  const result = await lilconfig("tailwindcss", {
764
765
  searchPlaces: [
765
766
  `${moduleName}.config.js`,
@@ -771,12 +772,12 @@ async function processTailwindcss(options) {
771
772
  ],
772
773
  loaders: {
773
774
  // 默认支持 js 和 cjs 2种格式
774
- ".js": tsx,
775
- ".cjs": tsx,
776
- ".mjs": tsx,
777
- ".ts": tsx,
778
- ".cts": tsx,
779
- ".mts": tsx
775
+ ".js": jiti,
776
+ ".cjs": jiti,
777
+ ".mjs": jiti,
778
+ ".ts": jiti,
779
+ ".cts": jiti,
780
+ ".mts": jiti
780
781
  }
781
782
  }).search(cwd);
782
783
  if (!result) {
package/dist/cli.cjs CHANGED
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  mod
24
24
  ));
25
25
 
26
- // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.3.3_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
26
+ // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.0_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
27
27
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
28
28
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
29
29
 
@@ -292,9 +292,11 @@ function isObject(val) {
292
292
  // src/core/postcss.ts
293
293
  var import_node_module = require("module");
294
294
  var import_node_process3 = __toESM(require("process"), 1);
295
+ var import_jiti = require("jiti");
295
296
  var import_lilconfig = require("lilconfig");
296
297
  var import_pathe3 = __toESM(require("pathe"), 1);
297
298
  var import_postcss = __toESM(require("postcss"), 1);
299
+ var jiti = (0, import_jiti.createJiti)(importMetaUrl);
298
300
  var require2 = (0, import_node_module.createRequire)(importMetaUrl);
299
301
  async function processTailwindcss(options) {
300
302
  const { config: userConfig, cwd } = defu(options, {
@@ -303,7 +305,6 @@ async function processTailwindcss(options) {
303
305
  let config = userConfig;
304
306
  if (!(typeof config === "string" && import_pathe3.default.isAbsolute(config))) {
305
307
  const moduleName = "tailwind";
306
- const tsx = (await import("tsx/cjs/api")).require;
307
308
  const result = await (0, import_lilconfig.lilconfig)("tailwindcss", {
308
309
  searchPlaces: [
309
310
  `${moduleName}.config.js`,
@@ -315,12 +316,12 @@ async function processTailwindcss(options) {
315
316
  ],
316
317
  loaders: {
317
318
  // 默认支持 js 和 cjs 2种格式
318
- ".js": tsx,
319
- ".cjs": tsx,
320
- ".mjs": tsx,
321
- ".ts": tsx,
322
- ".cts": tsx,
323
- ".mts": tsx
319
+ ".js": jiti,
320
+ ".cjs": jiti,
321
+ ".mjs": jiti,
322
+ ".ts": jiti,
323
+ ".cts": jiti,
324
+ ".mts": jiti
324
325
  }
325
326
  }).search(cwd);
326
327
  if (!result) {
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  config_exports,
4
4
  getPatchOptions,
5
5
  logger_default
6
- } from "./chunk-P2MLMFLP.js";
6
+ } from "./chunk-LOQK6LST.js";
7
7
 
8
8
  // src/cli.ts
9
9
  import process from "node:process";
package/dist/index.cjs CHANGED
@@ -43,7 +43,7 @@ __export(src_exports, {
43
43
  });
44
44
  module.exports = __toCommonJS(src_exports);
45
45
 
46
- // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.3.3_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
46
+ // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.0_postcss@8.4.47_tsx@4.19.2_typescript@5.6.3_yaml@2.6.0/node_modules/tsup/assets/cjs_shims.js
47
47
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
48
48
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
49
49
 
@@ -308,9 +308,11 @@ function isObject(val) {
308
308
  // src/core/postcss.ts
309
309
  var import_node_module = require("module");
310
310
  var import_node_process3 = __toESM(require("process"), 1);
311
+ var import_jiti = require("jiti");
311
312
  var import_lilconfig = require("lilconfig");
312
313
  var import_pathe3 = __toESM(require("pathe"), 1);
313
314
  var import_postcss = __toESM(require("postcss"), 1);
315
+ var jiti = (0, import_jiti.createJiti)(importMetaUrl);
314
316
  var require2 = (0, import_node_module.createRequire)(importMetaUrl);
315
317
  async function processTailwindcss(options) {
316
318
  const { config: userConfig, cwd } = defu(options, {
@@ -319,7 +321,6 @@ async function processTailwindcss(options) {
319
321
  let config = userConfig;
320
322
  if (!(typeof config === "string" && import_pathe3.default.isAbsolute(config))) {
321
323
  const moduleName = "tailwind";
322
- const tsx = (await import("tsx/cjs/api")).require;
323
324
  const result = await (0, import_lilconfig.lilconfig)("tailwindcss", {
324
325
  searchPlaces: [
325
326
  `${moduleName}.config.js`,
@@ -331,12 +332,12 @@ async function processTailwindcss(options) {
331
332
  ],
332
333
  loaders: {
333
334
  // 默认支持 js 和 cjs 2种格式
334
- ".js": tsx,
335
- ".cjs": tsx,
336
- ".mjs": tsx,
337
- ".ts": tsx,
338
- ".cts": tsx,
339
- ".mts": tsx
335
+ ".js": jiti,
336
+ ".cjs": jiti,
337
+ ".mjs": jiti,
338
+ ".ts": jiti,
339
+ ".cts": jiti,
340
+ ".mts": jiti
340
341
  }
341
342
  }).search(cwd);
342
343
  if (!result) {
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  monkeyPatchForExposingContextV2,
9
9
  monkeyPatchForExposingContextV3,
10
10
  monkeyPatchForSupportingCustomUnit
11
- } from "./chunk-P2MLMFLP.js";
11
+ } from "./chunk-LOQK6LST.js";
12
12
  var export_defineConfig = config_exports.defineConfig;
13
13
  export {
14
14
  CacheManager,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tailwindcss-patch",
3
3
  "type": "module",
4
- "version": "5.0.1",
4
+ "version": "5.0.2",
5
5
  "description": "patch tailwindcss for exposing context and extract classes",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -51,19 +51,19 @@
51
51
  }
52
52
  },
53
53
  "dependencies": {
54
- "@babel/generator": "^7.26.0",
55
- "@babel/parser": "^7.26.1",
54
+ "@babel/generator": "^7.26.2",
55
+ "@babel/parser": "^7.26.2",
56
56
  "@babel/traverse": "^7.25.9",
57
57
  "@babel/types": "^7.26.0",
58
58
  "cac": "^6.7.14",
59
59
  "consola": "^3.2.3",
60
60
  "fs-extra": "^11.2.0",
61
+ "jiti": "^2.4.0",
61
62
  "lilconfig": "^3.1.2",
62
63
  "pathe": "^1.1.2",
63
64
  "postcss": "^8.4.47",
64
65
  "resolve": "^1.22.8",
65
66
  "semver": "^7.6.3",
66
- "tsx": "^4.19.2",
67
67
  "@tailwindcss-mangle/config": "^4.0.1"
68
68
  },
69
69
  "scripts": {