weapp-tailwindcss 4.9.1 → 4.9.2-alpha.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.
Files changed (46) hide show
  1. package/dist/{chunk-ORSWL3MI.js → chunk-2WPTDMN3.js} +2 -2
  2. package/dist/{chunk-APJY6PQW.js → chunk-5O6237HX.js} +55 -31
  3. package/dist/{chunk-J4FEPPRP.mjs → chunk-6HBFEXOW.mjs} +2 -2
  4. package/dist/{chunk-7JV2EGN7.mjs → chunk-CF7VDUIE.mjs} +4 -4
  5. package/dist/{chunk-SM5V25IN.mjs → chunk-FFGR5V3H.mjs} +1 -1
  6. package/dist/{chunk-CYKRAS6K.js → chunk-J7KULRTR.js} +7 -7
  7. package/dist/{chunk-VNGPHRAS.mjs → chunk-JOLM54PI.mjs} +2 -2
  8. package/dist/{chunk-WOJCMQDF.js → chunk-KA2JONAP.js} +5 -5
  9. package/dist/{chunk-BIFOYWIB.js → chunk-NGRAUBWU.js} +23 -23
  10. package/dist/{chunk-65CKEW6P.js → chunk-OGG7WXHZ.js} +29 -29
  11. package/dist/{chunk-W33YZK2C.mjs → chunk-OU2OBBPZ.mjs} +2 -2
  12. package/dist/{chunk-O35YNDUX.mjs → chunk-QA5NZSGN.mjs} +1 -1
  13. package/dist/{chunk-MB4BR57E.js → chunk-UAEME5HT.js} +1 -1
  14. package/dist/{chunk-YDM2M3NT.js → chunk-W4XFWZB5.js} +5 -5
  15. package/dist/{chunk-BC6TZREM.mjs → chunk-XWGIWOHV.mjs} +2 -2
  16. package/dist/{chunk-F4HOQ6DE.js → chunk-YBTRKOE2.js} +7 -7
  17. package/dist/{chunk-HEBIKTBC.mjs → chunk-ZE7JKKFT.mjs} +39 -15
  18. package/dist/cli.js +39 -39
  19. package/dist/cli.mjs +3 -3
  20. package/dist/core.js +10 -10
  21. package/dist/core.mjs +4 -4
  22. package/dist/css-macro/postcss.js +1 -1
  23. package/dist/css-macro/postcss.mjs +1 -1
  24. package/dist/css-macro.js +1 -1
  25. package/dist/css-macro.mjs +1 -1
  26. package/dist/defaults.js +1 -1
  27. package/dist/defaults.mjs +1 -1
  28. package/dist/gulp.js +6 -6
  29. package/dist/gulp.mjs +5 -5
  30. package/dist/index.js +10 -10
  31. package/dist/index.mjs +8 -8
  32. package/dist/postcss-html-transform.js +1 -1
  33. package/dist/postcss-html-transform.mjs +1 -1
  34. package/dist/presets.js +5 -5
  35. package/dist/presets.mjs +2 -2
  36. package/dist/reset.js +1 -1
  37. package/dist/reset.mjs +1 -1
  38. package/dist/types.js +1 -1
  39. package/dist/types.mjs +1 -1
  40. package/dist/vite.js +7 -7
  41. package/dist/vite.mjs +5 -5
  42. package/dist/webpack.js +8 -8
  43. package/dist/webpack.mjs +6 -6
  44. package/dist/webpack4.js +32 -32
  45. package/dist/webpack4.mjs +5 -5
  46. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkMB4BR57Ejs = require('./chunk-MB4BR57E.js');
3
+ var _chunkUAEME5HTjs = require('./chunk-UAEME5HT.js');
4
4
 
5
5
  // src/bundlers/shared/module-graph.ts
6
6
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
@@ -74,7 +74,7 @@ function resolveDisabledOptions(disabled) {
74
74
  // src/utils/resolve-package.ts
75
75
  var _module = require('module');
76
76
 
77
- var require2 = _module.createRequire.call(void 0, _chunkMB4BR57Ejs.importMetaUrl);
77
+ var require2 = _module.createRequire.call(void 0, _chunkUAEME5HTjs.importMetaUrl);
78
78
  function resolvePackageDir(name) {
79
79
  const pkgPath = require2.resolve(`${name}/package.json`);
80
80
  return _path2.default.dirname(pkgPath);
@@ -3,7 +3,7 @@
3
3
  var _chunkDYLQ6UOIjs = require('./chunk-DYLQ6UOI.js');
4
4
 
5
5
 
6
- var _chunkMB4BR57Ejs = require('./chunk-MB4BR57E.js');
6
+ var _chunkUAEME5HTjs = require('./chunk-UAEME5HT.js');
7
7
 
8
8
  // src/logger/index.ts
9
9
  var _logger = require('@weapp-tailwindcss/logger');
@@ -234,7 +234,7 @@ function resolveModuleFromPaths(specifier, paths) {
234
234
  return void 0;
235
235
  }
236
236
  try {
237
- const req = _module.createRequire.call(void 0, _chunkMB4BR57Ejs.importMetaUrl);
237
+ const req = _module.createRequire.call(void 0, _chunkUAEME5HTjs.importMetaUrl);
238
238
  return req.resolve(specifier, { paths });
239
239
  } catch (e3) {
240
240
  return void 0;
@@ -334,11 +334,11 @@ function createDefaultResolvePaths(basedir) {
334
334
  const cwd = _process2.default.cwd();
335
335
  appendNodeModules(paths, cwd);
336
336
  try {
337
- const modulePath = _url.fileURLToPath.call(void 0, _chunkMB4BR57Ejs.importMetaUrl);
337
+ const modulePath = _url.fileURLToPath.call(void 0, _chunkUAEME5HTjs.importMetaUrl);
338
338
  const candidate = _fs.existsSync.call(void 0, modulePath) && !_path2.default.extname(modulePath) ? modulePath : _path2.default.dirname(modulePath);
339
339
  paths.add(candidate);
340
340
  } catch (e4) {
341
- paths.add(_chunkMB4BR57Ejs.importMetaUrl);
341
+ paths.add(_chunkUAEME5HTjs.importMetaUrl);
342
342
  }
343
343
  if (paths.size === 0) {
344
344
  fallbackCandidates = fallbackCandidates.filter(Boolean);
@@ -640,6 +640,7 @@ function groupCssEntriesByBase(entries, options = {}) {
640
640
  return groups;
641
641
  }
642
642
  function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries) {
643
+ const hasCssEntries = cssEntries.length > 0;
643
644
  if (!options) {
644
645
  return options;
645
646
  }
@@ -654,13 +655,20 @@ function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries)
654
655
  cwd: _nullishCoalesce(patchOptions.cwd, () => ( baseDir))
655
656
  };
656
657
  if (patchOptions.tailwindcss) {
658
+ const nextV4 = {
659
+ ..._nullishCoalesce(patchOptions.tailwindcss.v4, () => ( {}))
660
+ };
661
+ if (hasCssEntries) {
662
+ nextV4.cssEntries = cssEntries;
663
+ } else {
664
+ nextV4.cssEntries = _nullishCoalesce(nextV4.cssEntries, () => ( cssEntries));
665
+ if (nextV4.base === void 0) {
666
+ nextV4.base = baseDir;
667
+ }
668
+ }
657
669
  nextPatch.tailwindcss = {
658
670
  ...patchOptions.tailwindcss,
659
- v4: {
660
- ..._nullishCoalesce(patchOptions.tailwindcss.v4, () => ( {})),
661
- base: baseDir,
662
- cssEntries
663
- }
671
+ v4: nextV4
664
672
  };
665
673
  }
666
674
  return {
@@ -680,8 +688,8 @@ function overrideTailwindcssPatcherOptionsForBase(options, baseDir, cssEntries)
680
688
  ...options.tailwind,
681
689
  v4: {
682
690
  ..._nullishCoalesce(options.tailwind.v4, () => ( {})),
683
- base: baseDir,
684
- cssEntries
691
+ ...hasCssEntries ? {} : { base: _nullishCoalesce(_optionalChain([options, 'access', _40 => _40.tailwind, 'access', _41 => _41.v4, 'optionalAccess', _42 => _42.base]), () => ( baseDir)) },
692
+ cssEntries: hasCssEntries ? cssEntries : _nullishCoalesce(_optionalChain([options, 'access', _43 => _43.tailwind, 'access', _44 => _44.v4, 'optionalAccess', _45 => _45.cssEntries]), () => ( cssEntries))
685
693
  }
686
694
  }
687
695
  };
@@ -692,6 +700,7 @@ function createPatcherForBase(baseDir, cssEntries, options) {
692
700
  tailwindcssPatcherOptions,
693
701
  supportCustomLengthUnitsPatch
694
702
  } = options;
703
+ const hasCssEntries = Boolean(_optionalChain([cssEntries, 'optionalAccess', _46 => _46.length]));
695
704
  const defaultTailwindcssConfig = {
696
705
  cwd: baseDir,
697
706
  v2: {
@@ -700,12 +709,12 @@ function createPatcherForBase(baseDir, cssEntries, options) {
700
709
  v3: {
701
710
  cwd: baseDir
702
711
  },
703
- v4: {
712
+ v4: hasCssEntries ? { cssEntries } : {
704
713
  base: baseDir,
705
714
  cssEntries
706
715
  }
707
716
  };
708
- if (_optionalChain([cssEntries, 'optionalAccess', _40 => _40.length]) && (tailwindcss == null || tailwindcss.version == null)) {
717
+ if (hasCssEntries && (tailwindcss == null || tailwindcss.version == null)) {
709
718
  defaultTailwindcssConfig.version = 4;
710
719
  }
711
720
  const mergedTailwindOptions = _chunkDYLQ6UOIjs.defuOverrideArray.call(void 0,
@@ -713,16 +722,22 @@ function createPatcherForBase(baseDir, cssEntries, options) {
713
722
  defaultTailwindcssConfig
714
723
  );
715
724
  if (!mergedTailwindOptions.v4) {
716
- mergedTailwindOptions.v4 = {
725
+ mergedTailwindOptions.v4 = hasCssEntries ? { cssEntries: _nullishCoalesce(cssEntries, () => ( [])) } : {
717
726
  base: baseDir,
718
727
  cssEntries: _nullishCoalesce(cssEntries, () => ( []))
719
728
  };
720
729
  } else {
721
- mergedTailwindOptions.v4.base = baseDir;
722
- if (_optionalChain([cssEntries, 'optionalAccess', _41 => _41.length])) {
723
- mergedTailwindOptions.v4.cssEntries = cssEntries;
730
+ if (!hasCssEntries && !mergedTailwindOptions.v4.base) {
731
+ mergedTailwindOptions.v4.base = baseDir;
732
+ }
733
+ if (hasCssEntries) {
734
+ if (_optionalChain([cssEntries, 'optionalAccess', _47 => _47.length])) {
735
+ mergedTailwindOptions.v4.cssEntries = cssEntries;
736
+ } else if (!mergedTailwindOptions.v4.cssEntries) {
737
+ mergedTailwindOptions.v4.cssEntries = [];
738
+ }
724
739
  } else if (!mergedTailwindOptions.v4.cssEntries) {
725
- mergedTailwindOptions.v4.cssEntries = [];
740
+ mergedTailwindOptions.v4.cssEntries = _nullishCoalesce(cssEntries, () => ( []));
726
741
  }
727
742
  }
728
743
  const patchedOptions = overrideTailwindcssPatcherOptionsForBase(
@@ -730,8 +745,8 @@ function createPatcherForBase(baseDir, cssEntries, options) {
730
745
  baseDir,
731
746
  _nullishCoalesce(cssEntries, () => ( []))
732
747
  );
733
- const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess', _42 => _42.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _43 => _43.tailwind, 'optionalAccess', _44 => _44.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _45 => _45.patch, 'optionalAccess', _46 => _46.tailwindcss, 'optionalAccess', _47 => _47.packageName]);
734
- const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess', _48 => _48.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _49 => _49.tailwind, 'optionalAccess', _50 => _50.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _51 => _51.patch, 'optionalAccess', _52 => _52.tailwindcss, 'optionalAccess', _53 => _53.version]) || mergedTailwindOptions.version;
748
+ const configuredPackageName = _optionalChain([tailwindcss, 'optionalAccess', _48 => _48.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _49 => _49.tailwind, 'optionalAccess', _50 => _50.packageName]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _51 => _51.patch, 'optionalAccess', _52 => _52.tailwindcss, 'optionalAccess', _53 => _53.packageName]);
749
+ const configuredVersion = _optionalChain([tailwindcss, 'optionalAccess', _54 => _54.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _55 => _55.tailwind, 'optionalAccess', _56 => _56.version]) || _optionalChain([tailwindcssPatcherOptions, 'optionalAccess', _57 => _57.patch, 'optionalAccess', _58 => _58.tailwindcss, 'optionalAccess', _59 => _59.version]) || mergedTailwindOptions.version;
735
750
  const isTailwindcss4Package = (packageName) => Boolean(
736
751
  packageName && (packageName === "tailwindcss4" || packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4"))
737
752
  );
@@ -765,18 +780,19 @@ function createMultiTailwindcssPatcher(patchers) {
765
780
  }
766
781
  const [first] = patchers;
767
782
  const multiPatcher = {
768
- packageInfo: _optionalChain([first, 'optionalAccess', _54 => _54.packageInfo]),
769
- majorVersion: _optionalChain([first, 'optionalAccess', _55 => _55.majorVersion]),
770
- options: _optionalChain([first, 'optionalAccess', _56 => _56.options]),
783
+ ...first,
784
+ packageInfo: _optionalChain([first, 'optionalAccess', _60 => _60.packageInfo]),
785
+ majorVersion: _optionalChain([first, 'optionalAccess', _61 => _61.majorVersion]),
786
+ options: _optionalChain([first, 'optionalAccess', _62 => _62.options]),
771
787
  async patch() {
772
788
  let exposeContext;
773
789
  let extendLengthUnits;
774
790
  for (const patcher of patchers) {
775
791
  const result = await patcher.patch();
776
- if (_optionalChain([result, 'optionalAccess', _57 => _57.exposeContext]) && exposeContext == null) {
792
+ if (_optionalChain([result, 'optionalAccess', _63 => _63.exposeContext]) && exposeContext == null) {
777
793
  exposeContext = result.exposeContext;
778
794
  }
779
- if (_optionalChain([result, 'optionalAccess', _58 => _58.extendLengthUnits]) && extendLengthUnits == null) {
795
+ if (_optionalChain([result, 'optionalAccess', _64 => _64.extendLengthUnits]) && extendLengthUnits == null) {
780
796
  extendLengthUnits = result.extendLengthUnits;
781
797
  }
782
798
  }
@@ -832,7 +848,7 @@ function createMultiTailwindcssPatcher(patchers) {
832
848
  multiPatcher.getClassSetSync = () => {
833
849
  const aggregated = /* @__PURE__ */ new Set();
834
850
  for (const patcher of patchers) {
835
- const current = _optionalChain([patcher, 'access', _59 => _59.getClassSetSync, 'optionalCall', _60 => _60()]);
851
+ const current = _optionalChain([patcher, 'access', _65 => _65.getClassSetSync, 'optionalCall', _66 => _66()]);
836
852
  if (!current) {
837
853
  continue;
838
854
  }
@@ -911,7 +927,7 @@ function detectCallerBasedir() {
911
927
  const lines = stack.split("\n");
912
928
  for (const line of lines) {
913
929
  const match = _nullishCoalesce(line.match(/\(([^)]+)\)/u), () => ( line.match(/at\s+(\S.*)$/u)));
914
- const location = _optionalChain([match, 'optionalAccess', _61 => _61[1]]);
930
+ const location = _optionalChain([match, 'optionalAccess', _67 => _67[1]]);
915
931
  if (!location) {
916
932
  continue;
917
933
  }
@@ -941,8 +957,8 @@ function detectCallerBasedir() {
941
957
  }
942
958
  function resolveTailwindcssBasedir(basedir, fallback) {
943
959
  const envBasedirResult = pickEnvBasedir();
944
- const envBasedir = _optionalChain([envBasedirResult, 'optionalAccess', _62 => _62.value]);
945
- const envBasedirKey = _optionalChain([envBasedirResult, 'optionalAccess', _63 => _63.key]);
960
+ const envBasedir = _optionalChain([envBasedirResult, 'optionalAccess', _68 => _68.value]);
961
+ const envBasedirKey = _optionalChain([envBasedirResult, 'optionalAccess', _69 => _69.key]);
946
962
  const envBasedirIsGeneric = envBasedirKey ? GENERIC_ENV_BASEDIR_KEYS.has(envBasedirKey) : false;
947
963
  const packageEnvBasedir = pickPackageEnvBasedir();
948
964
  const shouldDetectCaller = !envBasedir || envBasedirIsGeneric;
@@ -1090,8 +1106,16 @@ function createTailwindcssPatcherFromContext(ctx) {
1090
1106
  if (normalizedCssEntries) {
1091
1107
  ctx.cssEntries = normalizedCssEntries;
1092
1108
  }
1109
+ const shouldAttachBase = Boolean(ctx.tailwindcssBasedir && _optionalChain([normalizedCssEntries, 'optionalAccess', _70 => _70.length]));
1110
+ const tailwindcssWithBase = shouldAttachBase && _optionalChain([tailwindcss, 'optionalAccess', _71 => _71.v4]) !== null ? {
1111
+ ..._nullishCoalesce(tailwindcss, () => ( {})),
1112
+ v4: {
1113
+ ..._nullishCoalesce(_optionalChain([tailwindcss, 'optionalAccess', _72 => _72.v4]), () => ( {})),
1114
+ base: _nullishCoalesce(_optionalChain([tailwindcss, 'optionalAccess', _73 => _73.v4, 'optionalAccess', _74 => _74.base]), () => ( resolvedTailwindcssBasedir))
1115
+ }
1116
+ } : tailwindcss;
1093
1117
  const patcherOptions = {
1094
- tailwindcss,
1118
+ tailwindcss: tailwindcssWithBase,
1095
1119
  tailwindcssPatcherOptions,
1096
1120
  supportCustomLengthUnitsPatch,
1097
1121
  appType
@@ -1105,7 +1129,7 @@ function createTailwindcssPatcherFromContext(ctx) {
1105
1129
  if (multiPatcher) {
1106
1130
  return multiPatcher;
1107
1131
  }
1108
- if (_optionalChain([groupedCssEntries, 'optionalAccess', _64 => _64.size]) === 1) {
1132
+ if (_optionalChain([groupedCssEntries, 'optionalAccess', _75 => _75.size]) === 1) {
1109
1133
  const firstGroup = groupedCssEntries.entries().next().value;
1110
1134
  if (firstGroup) {
1111
1135
  const [baseDir, entries] = firstGroup;
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-RRHPTTCP.mjs";
13
13
  import {
14
14
  setupPatchRecorder
15
- } from "./chunk-BC6TZREM.mjs";
15
+ } from "./chunk-XWGIWOHV.mjs";
16
16
  import {
17
17
  collectRuntimeClassSet,
18
18
  createAttributeMatcher,
@@ -23,7 +23,7 @@ import {
23
23
  replaceWxml,
24
24
  toCustomAttributesEntities,
25
25
  vitePluginName
26
- } from "./chunk-W33YZK2C.mjs";
26
+ } from "./chunk-OU2OBBPZ.mjs";
27
27
  import {
28
28
  getGroupedEntries,
29
29
  resolveUniUtsPlatform
@@ -9,7 +9,7 @@ import {
9
9
  isMpx,
10
10
  patchMpxLoaderResolve,
11
11
  setupMpxTailwindcssRedirect
12
- } from "./chunk-O35YNDUX.mjs";
12
+ } from "./chunk-QA5NZSGN.mjs";
13
13
  import {
14
14
  pushConcurrentTaskFactories,
15
15
  resolveDisabledOptions,
@@ -22,20 +22,20 @@ import {
22
22
  } from "./chunk-RRHPTTCP.mjs";
23
23
  import {
24
24
  setupPatchRecorder
25
- } from "./chunk-BC6TZREM.mjs";
25
+ } from "./chunk-XWGIWOHV.mjs";
26
26
  import {
27
27
  collectRuntimeClassSet,
28
28
  createDebug,
29
29
  getCompilerContext,
30
30
  pluginName,
31
31
  refreshTailwindRuntimeState
32
- } from "./chunk-W33YZK2C.mjs";
32
+ } from "./chunk-OU2OBBPZ.mjs";
33
33
  import {
34
34
  getGroupedEntries
35
35
  } from "./chunk-OOHJLO5M.mjs";
36
36
  import {
37
37
  __dirname
38
- } from "./chunk-SM5V25IN.mjs";
38
+ } from "./chunk-FFGR5V3H.mjs";
39
39
 
40
40
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
41
41
  import fs from "fs";
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.53.1_@types+node@24.10.4__@swc+core@1.15.7_@swc+h_167688d692077c8a2d82cc2e420b5ebb/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.10.4__@swc+core@1.15.7_@swc+h_4d5dc336679991eff78ae0f04625a6b1/node_modules/tsup/assets/esm_shims.js
2
2
  import path from "path";
3
3
  import { fileURLToPath } from "url";
4
4
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkAPJY6PQWjs = require('./chunk-APJY6PQW.js');
6
+ var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
7
7
 
8
8
 
9
9
  var _chunkFYYBY3VKjs = require('./chunk-FYYBY3VK.js');
@@ -187,7 +187,7 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
187
187
  // package.json
188
188
  var package_default = {
189
189
  name: "weapp-tailwindcss",
190
- version: "4.9.1",
190
+ version: "4.9.2-alpha.2",
191
191
  description: "\u628A tailwindcss \u539F\u5B50\u5316\u6837\u5F0F\u601D\u60F3\uFF0C\u5E26\u7ED9\u5C0F\u7A0B\u5E8F\u5F00\u53D1\u8005\u4EEC! bring tailwindcss to miniprogram developers!",
192
192
  author: "ice breaker <1324318532@qq.com>",
193
193
  license: "MIT",
@@ -543,7 +543,7 @@ function formatRelativeToBase(targetPath, baseDir) {
543
543
  }
544
544
  function resolveRecordLocation(baseDir) {
545
545
  const normalizedBase = _path2.default.normalize(baseDir);
546
- const packageRoot = _nullishCoalesce(_chunkAPJY6PQWjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
546
+ const packageRoot = _nullishCoalesce(_chunk5O6237HXjs.findNearestPackageRoot.call(void 0, normalizedBase), () => ( normalizedBase));
547
547
  const packageJsonPath = _path2.default.join(packageRoot, "package.json");
548
548
  const hasPackageJson = _fs.existsSync.call(void 0, packageJsonPath);
549
549
  const recordKeySource = hasPackageJson ? packageJsonPath : normalizedBase;
@@ -2771,15 +2771,15 @@ function createInternalCompilerContext(opts) {
2771
2771
  );
2772
2772
  ctx.escapeMap = ctx.customReplaceDictionary;
2773
2773
  applyLoggerLevel(ctx.logLevel);
2774
- const twPatcher = _chunkAPJY6PQWjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2774
+ const twPatcher = _chunk5O6237HXjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2775
2775
  logTailwindcssTarget("runtime", twPatcher, ctx.tailwindcssBasedir);
2776
2776
  if (_optionalChain([twPatcher, 'access', _95 => _95.packageInfo, 'optionalAccess', _96 => _96.version])) {
2777
2777
  _logger.logger.success(`\u5F53\u524D\u4F7F\u7528 ${_logger.pc.cyanBright("Tailwind CSS")} \u7248\u672C\u4E3A: ${_logger.pc.underline(_logger.pc.bold(_logger.pc.green(twPatcher.packageInfo.version)))}`);
2778
2778
  } else {
2779
2779
  _logger.logger.warn(`${_logger.pc.cyanBright("Tailwind CSS")} \u672A\u5B89\u88C5\uFF0C\u5DF2\u8DF3\u8FC7\u7248\u672C\u68C0\u6D4B\u4E0E\u8865\u4E01\u5E94\u7528\u3002`);
2780
2780
  }
2781
- _chunkAPJY6PQWjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
2782
- const cssCalcOptions = _chunkAPJY6PQWjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
2781
+ _chunk5O6237HXjs.warnMissingCssEntries.call(void 0, ctx, twPatcher);
2782
+ const cssCalcOptions = _chunk5O6237HXjs.applyV4CssCalcDefaults.call(void 0, ctx.cssCalc, twPatcher);
2783
2783
  ctx.cssCalc = cssCalcOptions;
2784
2784
  const customAttributesEntities = toCustomAttributesEntities(ctx.customAttributes);
2785
2785
  const { styleHandler, jsHandler: jsHandler2, templateHandler } = createHandlersFromContext(
@@ -2798,7 +2798,7 @@ function createInternalCompilerContext(opts) {
2798
2798
  await clearTailwindcssPatcherCache(previousPatcher);
2799
2799
  }
2800
2800
  invalidateRuntimeClassSet(previousPatcher);
2801
- const nextPatcher = _chunkAPJY6PQWjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2801
+ const nextPatcher = _chunk5O6237HXjs.createTailwindcssPatcherFromContext.call(void 0, ctx);
2802
2802
  Object.assign(previousPatcher, nextPatcher);
2803
2803
  ctx.twPatcher = previousPatcher;
2804
2804
  return previousPatcher;
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-RRHPTTCP.mjs";
4
4
  import {
5
5
  setupPatchRecorder
6
- } from "./chunk-BC6TZREM.mjs";
6
+ } from "./chunk-XWGIWOHV.mjs";
7
7
  import {
8
8
  collectRuntimeClassSet,
9
9
  createDebug,
10
10
  getCompilerContext,
11
11
  refreshTailwindRuntimeState
12
- } from "./chunk-W33YZK2C.mjs";
12
+ } from "./chunk-OU2OBBPZ.mjs";
13
13
 
14
14
  // src/bundlers/gulp/index.ts
15
15
  import { Buffer } from "buffer";
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
3
 
4
- var _chunkCYKRAS6Kjs = require('./chunk-CYKRAS6K.js');
4
+ var _chunkJ7KULRTRjs = require('./chunk-J7KULRTR.js');
5
5
 
6
6
 
7
- var _chunkAPJY6PQWjs = require('./chunk-APJY6PQW.js');
7
+ var _chunk5O6237HXjs = require('./chunk-5O6237HX.js');
8
8
 
9
9
  // src/tailwindcss/recorder.ts
10
10
  function setupPatchRecorder(patcher, baseDir, options) {
11
- const recorder = _chunkCYKRAS6Kjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
11
+ const recorder = _chunkJ7KULRTRjs.createPatchTargetRecorder.call(void 0, baseDir, patcher, options);
12
12
  if (_optionalChain([recorder, 'optionalAccess', _ => _.message]) && _optionalChain([options, 'optionalAccess', _2 => _2.logMessage]) !== false) {
13
13
  const prefix = _optionalChain([options, 'optionalAccess', _3 => _3.messagePrefix]) ? `${options.messagePrefix} ` : "";
14
- _chunkAPJY6PQWjs.logger.info("%s%s", prefix, recorder.message);
14
+ _chunk5O6237HXjs.logger.info("%s%s", prefix, recorder.message);
15
15
  }
16
16
  const onPatchCompleted = _optionalChain([recorder, 'optionalAccess', _4 => _4.onPatched]) ? async () => {
17
17
  await recorder.onPatched();
18
18
  } : void 0;
19
- const patchPromise = patcher ? _chunkCYKRAS6Kjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
19
+ const patchPromise = patcher ? _chunkJ7KULRTRjs.createTailwindPatchPromise.call(void 0, patcher, onPatchCompleted) : Promise.resolve();
20
20
  return {
21
21
  recorder,
22
22
  patchPromise,
@@ -6,13 +6,13 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
9
+ var _chunk2WPTDMN3js = require('./chunk-2WPTDMN3.js');
10
10
 
11
11
 
12
12
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
13
13
 
14
14
 
15
- var _chunkWOJCMQDFjs = require('./chunk-WOJCMQDF.js');
15
+ var _chunkKA2JONAPjs = require('./chunk-KA2JONAP.js');
16
16
 
17
17
 
18
18
 
@@ -23,7 +23,7 @@ var _chunkWOJCMQDFjs = require('./chunk-WOJCMQDF.js');
23
23
 
24
24
 
25
25
 
26
- var _chunkCYKRAS6Kjs = require('./chunk-CYKRAS6K.js');
26
+ var _chunkJ7KULRTRjs = require('./chunk-J7KULRTR.js');
27
27
 
28
28
 
29
29
 
@@ -56,7 +56,7 @@ function updateStaticAttribute(ms, prop) {
56
56
  const start = prop.value.loc.start.offset + 1;
57
57
  const end = prop.value.loc.end.offset - 1;
58
58
  if (start < end) {
59
- ms.update(start, end, _chunkCYKRAS6Kjs.replaceWxml.call(void 0, prop.value.content));
59
+ ms.update(start, end, _chunkJ7KULRTRjs.replaceWxml.call(void 0, prop.value.content));
60
60
  }
61
61
  }
62
62
  function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
@@ -68,7 +68,7 @@ function updateDirectiveExpression(ms, prop, jsHandler, runtimeSet) {
68
68
  if (start >= end) {
69
69
  return;
70
70
  }
71
- const generated = _chunkCYKRAS6Kjs.generateCode.call(void 0, prop.exp.content, {
71
+ const generated = _chunkJ7KULRTRjs.generateCode.call(void 0, prop.exp.content, {
72
72
  jsHandler,
73
73
  runtimeSet,
74
74
  wrapExpression: true
@@ -97,7 +97,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
97
97
  return;
98
98
  }
99
99
  const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
100
- const matchCustomAttribute = _chunkCYKRAS6Kjs.createAttributeMatcher.call(void 0, customAttributesEntities);
100
+ const matchCustomAttribute = _chunkJ7KULRTRjs.createAttributeMatcher.call(void 0, customAttributesEntities);
101
101
  const ms = new (0, _magicstring2.default)(code);
102
102
  const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
103
103
  if (errors.length === 0) {
@@ -364,7 +364,7 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
364
364
  runtimeSet,
365
365
  applyLinkedResults: applyLinkedResults2
366
366
  } = options;
367
- const absoluteFile = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, file, outDir);
367
+ const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outDir);
368
368
  const rawSource = originalSource.source.toString();
369
369
  await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
370
370
  cache,
@@ -399,8 +399,8 @@ function createUniAppXAssetTask(file, originalSource, outDir, options) {
399
399
  }
400
400
 
401
401
  // src/bundlers/vite/index.ts
402
- var debug = _chunkCYKRAS6Kjs.createDebug.call(void 0, );
403
- var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
402
+ var debug = _chunkJ7KULRTRjs.createDebug.call(void 0, );
403
+ var weappTailwindcssPackageDir = _chunk2WPTDMN3js.resolvePackageDir.call(void 0, "weapp-tailwindcss");
404
404
  var weappTailwindcssDirPosix = slash(weappTailwindcssPackageDir);
405
405
  function joinPosixPath(base, subpath) {
406
406
  if (base.endsWith("/")) {
@@ -444,7 +444,7 @@ function isJavaScriptEntry(entry) {
444
444
  function createBundleModuleGraphOptions(outputDir, entries) {
445
445
  return {
446
446
  resolve(specifier, importer) {
447
- return _chunkORSWL3MIjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
447
+ return _chunk2WPTDMN3js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => entries.has(candidate));
448
448
  },
449
449
  load(id) {
450
450
  const entry = entries.get(id);
@@ -482,7 +482,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
482
482
  }
483
483
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
484
484
  const rewriteCssImportsSpecified = Object.prototype.hasOwnProperty.call(options, "rewriteCssImports");
485
- const opts = _chunkCYKRAS6Kjs.getCompilerContext.call(void 0, options);
485
+ const opts = _chunkJ7KULRTRjs.getCompilerContext.call(void 0, options);
486
486
  const {
487
487
  disabled,
488
488
  customAttributes,
@@ -501,17 +501,17 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
501
501
  uniAppX,
502
502
  disabledDefaultTemplateHandler
503
503
  } = opts;
504
- const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
504
+ const disabledOptions = _chunk2WPTDMN3js.resolveDisabledOptions.call(void 0, disabled);
505
505
  const tailwindcssMajorVersion = _nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0));
506
506
  const shouldRewriteCssImports = opts.rewriteCssImports !== false && !disabledOptions.rewriteCssImports && (rewriteCssImportsSpecified || tailwindcssMajorVersion >= 4);
507
507
  const rewritePlugins = !shouldRewriteCssImports ? [] : [
508
508
  {
509
- name: `${_chunkCYKRAS6Kjs.vitePluginName}:rewrite-css-imports`,
509
+ name: `${_chunkJ7KULRTRjs.vitePluginName}:rewrite-css-imports`,
510
510
  enforce: "pre",
511
511
  resolveId: {
512
512
  order: "pre",
513
513
  handler(id, importer) {
514
- const replacement = _chunkORSWL3MIjs.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
514
+ const replacement = _chunk2WPTDMN3js.resolveTailwindcssImport.call(void 0, id, weappTailwindcssDirPosix, {
515
515
  join: joinPosixPath,
516
516
  appType
517
517
  });
@@ -530,7 +530,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
530
530
  if (!isCSSRequest(id)) {
531
531
  return null;
532
532
  }
533
- const rewritten = _chunkORSWL3MIjs.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
533
+ const rewritten = _chunk2WPTDMN3js.rewriteTailwindcssImportsInCode.call(void 0, code, weappTailwindcssDirPosix, {
534
534
  join: joinPosixPath,
535
535
  appType
536
536
  });
@@ -548,8 +548,8 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
548
548
  if (disabledOptions.plugin) {
549
549
  return rewritePlugins.length ? rewritePlugins : void 0;
550
550
  }
551
- const customAttributesEntities = _chunkCYKRAS6Kjs.toCustomAttributesEntities.call(void 0, customAttributes);
552
- const patchRecorderState = _chunkWOJCMQDFjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
551
+ const customAttributesEntities = _chunkJ7KULRTRjs.toCustomAttributesEntities.call(void 0, customAttributes);
552
+ const patchRecorderState = _chunkKA2JONAPjs.setupPatchRecorder.call(void 0, initialTwPatcher, opts.tailwindcssBasedir, {
553
553
  source: "runtime",
554
554
  cwd: _nullishCoalesce(opts.tailwindcssBasedir, () => ( _process2.default.cwd()))
555
555
  });
@@ -563,7 +563,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
563
563
  let runtimeSetPromise;
564
564
  let resolvedConfig;
565
565
  async function refreshRuntimeState(force) {
566
- const refreshed = await _chunkCYKRAS6Kjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
566
+ const refreshed = await _chunkJ7KULRTRjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
567
567
  if (refreshed) {
568
568
  runtimeSet = void 0;
569
569
  runtimeSetPromise = void 0;
@@ -576,7 +576,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
576
576
  return runtimeSet;
577
577
  }
578
578
  if (force || !runtimeSetPromise) {
579
- const task2 = _chunkCYKRAS6Kjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
579
+ const task2 = _chunkJ7KULRTRjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, {
580
580
  force: force || !runtimeSet,
581
581
  skipRefresh: force
582
582
  });
@@ -611,7 +611,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
611
611
  const plugins = [
612
612
  ...rewritePlugins,
613
613
  {
614
- name: `${_chunkCYKRAS6Kjs.vitePluginName}:post`,
614
+ name: `${_chunkJ7KULRTRjs.vitePluginName}:post`,
615
615
  enforce: "post",
616
616
  configResolved(config) {
617
617
  resolvedConfig = config;
@@ -637,7 +637,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
637
637
  for (const [fileName, output] of entries) {
638
638
  const entry = { fileName, output };
639
639
  if (isJavaScriptEntry(entry)) {
640
- const absolute = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, fileName, outDir);
640
+ const absolute = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, fileName, outDir);
641
641
  jsEntries.set(absolute, entry);
642
642
  }
643
643
  }
@@ -704,7 +704,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
704
704
  if (Array.isArray(groupedEntries.js)) {
705
705
  for (const [file, originalSource] of groupedEntries.js) {
706
706
  if (originalSource.type === "chunk") {
707
- const absoluteFile = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, file, outDir);
707
+ const absoluteFile = _chunk2WPTDMN3js.toAbsoluteOutputPath.call(void 0, file, outDir);
708
708
  const initialRawSource = originalSource.code;
709
709
  jsTaskFactories.push(async () => {
710
710
  await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
@@ -785,7 +785,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
785
785
  );
786
786
  }
787
787
  }
788
- _chunkORSWL3MIjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
788
+ _chunk2WPTDMN3js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
789
789
  await Promise.all(tasks);
790
790
  for (const apply of pendingLinkedUpdates) {
791
791
  apply();