weapp-tailwindcss 4.3.1 → 4.3.3

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 (47) hide show
  1. package/dist/chunk-2F7HOQQY.mjs +8 -0
  2. package/dist/{chunk-GRWK73SM.js → chunk-3KMEJ2LM.js} +49 -16
  3. package/dist/{chunk-DGVVFKNF.mjs → chunk-3KXFKRIX.mjs} +39 -6
  4. package/dist/{chunk-3YIQPUK7.mjs → chunk-5BTC4YQI.mjs} +1 -1
  5. package/dist/chunk-6GP37C26.js +8 -0
  6. package/dist/{chunk-72PXDJ7I.js → chunk-A75TB5TE.js} +6 -6
  7. package/dist/{chunk-RC2KZ2LO.mjs → chunk-GEUHO2UC.mjs} +1 -5
  8. package/dist/{chunk-YNMM5ZP5.mjs → chunk-GFQ2R7SX.mjs} +4 -12
  9. package/dist/{chunk-YSVQIZ4W.js → chunk-JDLLZFZX.js} +9 -9
  10. package/dist/{chunk-BXPTS6UP.mjs → chunk-L36QGA7Y.mjs} +1 -1
  11. package/dist/{chunk-AMSF25MI.js → chunk-L7VNJFIK.js} +7 -15
  12. package/dist/{chunk-IDYXPWF6.mjs → chunk-M7PVNKCH.mjs} +9 -9
  13. package/dist/{chunk-K6IPKJSY.js → chunk-O3G5TVND.js} +1 -1
  14. package/dist/{chunk-O335YLYH.js → chunk-QXQOYYCR.js} +1 -2
  15. package/dist/{chunk-K3KFCISK.js → chunk-TI4R65TB.js} +2 -6
  16. package/dist/{chunk-JXBLHLFR.mjs → chunk-Y5AFAYKI.mjs} +0 -1
  17. package/dist/cli.js +5 -5
  18. package/dist/cli.mjs +4 -4
  19. package/dist/core.js +5 -5
  20. package/dist/core.mjs +4 -4
  21. package/dist/css-macro/postcss.js +1 -1
  22. package/dist/css-macro/postcss.mjs +1 -1
  23. package/dist/css-macro.js +3 -3
  24. package/dist/css-macro.mjs +2 -2
  25. package/dist/defaults.js +4 -4
  26. package/dist/defaults.mjs +3 -3
  27. package/dist/escape.js +1 -1
  28. package/dist/escape.mjs +1 -1
  29. package/dist/gulp.js +6 -6
  30. package/dist/gulp.mjs +5 -5
  31. package/dist/index.js +9 -8
  32. package/dist/index.mjs +8 -7
  33. package/dist/postcss-html-transform.js +1 -1
  34. package/dist/postcss-html-transform.mjs +1 -1
  35. package/dist/presets.js +3 -3
  36. package/dist/presets.mjs +2 -2
  37. package/dist/types.d.mts +55 -2
  38. package/dist/types.d.ts +55 -2
  39. package/dist/types.js +1 -1
  40. package/dist/types.mjs +1 -1
  41. package/dist/vite.js +6 -6
  42. package/dist/vite.mjs +5 -5
  43. package/dist/webpack.js +7 -6
  44. package/dist/webpack.mjs +6 -5
  45. package/dist/webpack4.js +11 -11
  46. package/dist/webpack4.mjs +10 -10
  47. package/package.json +12 -13
@@ -0,0 +1,8 @@
1
+ // src/bundlers/webpack/BaseUnifiedPlugin/shared.ts
2
+ function getCacheKey(filename) {
3
+ return filename;
4
+ }
5
+
6
+ export {
7
+ getCacheKey
8
+ };
@@ -3,15 +3,15 @@
3
3
  var _chunkPLMJW644js = require('./chunk-PLMJW644.js');
4
4
 
5
5
 
6
- var _chunk72PXDJ7Ijs = require('./chunk-72PXDJ7I.js');
6
+ var _chunkA75TB5TEjs = require('./chunk-A75TB5TE.js');
7
7
 
8
8
 
9
9
 
10
10
 
11
- var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
11
+ var _chunkQXQOYYCRjs = require('./chunk-QXQOYYCR.js');
12
12
 
13
13
 
14
- var _chunkK6IPKJSYjs = require('./chunk-K6IPKJSY.js');
14
+ var _chunkO3G5TVNDjs = require('./chunk-O3G5TVND.js');
15
15
 
16
16
  // src/context/index.ts
17
17
  var _logger = require('@weapp-tailwindcss/logger');
@@ -344,7 +344,7 @@ var NodePathWalker = class {
344
344
  */
345
345
  walkCallExpression(path2) {
346
346
  const calleePath = path2.get("callee");
347
- if (calleePath.isIdentifier() && _chunkO335YLYHjs.regExpTest.call(void 0, this.ignoreCallExpressionIdentifiers, calleePath.node.name, {
347
+ if (calleePath.isIdentifier() && _chunkQXQOYYCRjs.regExpTest.call(void 0, this.ignoreCallExpressionIdentifiers, calleePath.node.name, {
348
348
  exact: true
349
349
  })) {
350
350
  for (const arg of path2.get("arguments")) {
@@ -469,7 +469,7 @@ function analyzeSource(ast, options) {
469
469
  }
470
470
  if (ppp.isTaggedTemplateExpression()) {
471
471
  const tagPath = ppp.get("tag");
472
- if (tagPath.isIdentifier() && _chunkO335YLYHjs.regExpTest.call(void 0, _nullishCoalesce(options.ignoreTaggedTemplateExpressionIdentifiers, () => ( [])), tagPath.node.name, { exact: true })) {
472
+ if (tagPath.isIdentifier() && _chunkQXQOYYCRjs.regExpTest.call(void 0, _nullishCoalesce(options.ignoreTaggedTemplateExpressionIdentifiers, () => ( [])), tagPath.node.name, { exact: true })) {
473
473
  return;
474
474
  }
475
475
  }
@@ -632,7 +632,7 @@ function createJsHandler(options) {
632
632
  uniAppX
633
633
  } = options;
634
634
  function handler(rawSource, classNameSet, options2) {
635
- const opts = _chunkO335YLYHjs.defuOverrideArray.call(void 0, options2, {
635
+ const opts = _chunkQXQOYYCRjs.defuOverrideArray.call(void 0, options2, {
636
636
  classNameSet,
637
637
  escapeMap,
638
638
  arbitraryValues,
@@ -682,7 +682,7 @@ function createTailwindcssPatcher(options) {
682
682
  tailwindcss,
683
683
  resolve: {
684
684
  paths: [
685
- _chunkK6IPKJSYjs.importMetaUrl
685
+ _chunkO3G5TVNDjs.importMetaUrl
686
686
  ]
687
687
  }
688
688
  }
@@ -703,7 +703,7 @@ var Tokenizer = class {
703
703
  processChar(char, index) {
704
704
  switch (this.state) {
705
705
  case 0 /* START */:
706
- if (char === " ") {
706
+ if (this.isWhitespace(char)) {
707
707
  } else if (char === "{") {
708
708
  this.state = 2 /* OPEN_BRACE */;
709
709
  this.bufferStartIndex = index;
@@ -717,7 +717,7 @@ var Tokenizer = class {
717
717
  }
718
718
  break;
719
719
  case 1 /* TEXT */:
720
- if (char === " ") {
720
+ if (this.isWhitespace(char)) {
721
721
  this.tokens.push({ start: this.bufferStartIndex, end: index, value: this.buffer, expressions: this.expressions });
722
722
  this.buffer = "";
723
723
  this.expressions = [];
@@ -759,7 +759,7 @@ var Tokenizer = class {
759
759
  }
760
760
  break;
761
761
  case 4 /* BRACES_COMPLETE */:
762
- if (char === " ") {
762
+ if (this.isWhitespace(char)) {
763
763
  this.tokens.push({
764
764
  start: this.bufferStartIndex,
765
765
  end: index,
@@ -784,6 +784,7 @@ var Tokenizer = class {
784
784
  }
785
785
  }
786
786
  run(input) {
787
+ this.reset();
787
788
  for (let i = 0; i < input.length; i++) {
788
789
  const char = input[i];
789
790
  this.processChar(char, i);
@@ -796,7 +797,9 @@ var Tokenizer = class {
796
797
  expressions: this.expressions
797
798
  });
798
799
  }
799
- return this.tokens;
800
+ const result = this.tokens.slice();
801
+ this.reset();
802
+ return result;
800
803
  }
801
804
  reset() {
802
805
  this.state = 0 /* START */;
@@ -807,6 +810,9 @@ var Tokenizer = class {
807
810
  this.expressionStartIndex = 0;
808
811
  this.expressions = [];
809
812
  }
813
+ isWhitespace(char) {
814
+ return /\s/.test(char);
815
+ }
810
816
  };
811
817
 
812
818
  // src/wxml/utils.ts
@@ -851,7 +857,19 @@ function generateCode(match, options = {}) {
851
857
  }
852
858
  }
853
859
  function handleEachClassFragment(ms, tokens, options = {}) {
860
+ let previousEnd = 0;
854
861
  for (const token of tokens) {
862
+ if (token.start > previousEnd) {
863
+ const gap = ms.slice(previousEnd, token.start);
864
+ if (gap.trim() === "") {
865
+ ms.update(previousEnd, token.start, _chunkPLMJW644js.replaceWxml.call(void 0, gap, {
866
+ keepEOL: false,
867
+ escapeMap: options.escapeMap,
868
+ mangleContext: options.mangleContext,
869
+ ignoreHead: true
870
+ }));
871
+ }
872
+ }
855
873
  let p = token.start;
856
874
  if (token.expressions.length > 0) {
857
875
  for (const exp of token.expressions) {
@@ -885,6 +903,21 @@ function handleEachClassFragment(ms, tokens, options = {}) {
885
903
  ignoreHead: false
886
904
  }));
887
905
  }
906
+ previousEnd = token.end;
907
+ }
908
+ if (tokens.length > 0) {
909
+ const lastToken = tokens[tokens.length - 1];
910
+ if (lastToken.end < ms.original.length) {
911
+ const gap = ms.slice(lastToken.end, ms.original.length);
912
+ if (gap.trim() === "") {
913
+ ms.update(lastToken.end, ms.original.length, _chunkPLMJW644js.replaceWxml.call(void 0, gap, {
914
+ keepEOL: false,
915
+ escapeMap: options.escapeMap,
916
+ mangleContext: options.mangleContext,
917
+ ignoreHead: true
918
+ }));
919
+ }
920
+ }
888
921
  }
889
922
  }
890
923
  function templateReplacer(original, options = {}) {
@@ -991,7 +1024,7 @@ async function customTemplateHandler(rawSource, options) {
991
1024
  }
992
1025
  function createTemplateHandler(options = {}) {
993
1026
  return (rawSource, opt = {}) => {
994
- return customTemplateHandler(rawSource, _chunkO335YLYHjs.defuOverrideArray.call(void 0, opt, options));
1027
+ return customTemplateHandler(rawSource, _chunkQXQOYYCRjs.defuOverrideArray.call(void 0, opt, options));
995
1028
  };
996
1029
  }
997
1030
 
@@ -1003,9 +1036,9 @@ var loggerLevelMap = {
1003
1036
  silent: -999
1004
1037
  };
1005
1038
  function getCompilerContext(opts) {
1006
- const ctx = _chunkO335YLYHjs.defuOverrideArray.call(void 0,
1039
+ const ctx = _chunkQXQOYYCRjs.defuOverrideArray.call(void 0,
1007
1040
  opts,
1008
- _chunk72PXDJ7Ijs.getDefaultOptions.call(void 0, ),
1041
+ _chunkA75TB5TEjs.getDefaultOptions.call(void 0, ),
1009
1042
  {}
1010
1043
  );
1011
1044
  ctx.escapeMap = ctx.customReplaceDictionary;
@@ -1049,7 +1082,7 @@ function getCompilerContext(opts) {
1049
1082
  basedir: tailwindcssBasedir,
1050
1083
  cacheDir: appType === "mpx" ? "node_modules/tailwindcss-patch/.cache" : void 0,
1051
1084
  supportCustomLengthUnitsPatch: _nullishCoalesce(supportCustomLengthUnitsPatch, () => ( true)),
1052
- tailwindcss: _chunkO335YLYHjs.defuOverrideArray.call(void 0,
1085
+ tailwindcss: _chunkQXQOYYCRjs.defuOverrideArray.call(void 0,
1053
1086
  tailwindcss,
1054
1087
  {
1055
1088
  v4: {
@@ -1063,7 +1096,7 @@ function getCompilerContext(opts) {
1063
1096
  );
1064
1097
  _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)))}`);
1065
1098
  const cssCalcOptions = _nullishCoalesce(cssCalc, () => ( twPatcher.majorVersion === 4));
1066
- const customAttributesEntities = _chunkO335YLYHjs.isMap.call(void 0, customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
1099
+ const customAttributesEntities = _chunkQXQOYYCRjs.isMap.call(void 0, customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
1067
1100
  const { initMangle, mangleContext, setMangleRuntimeSet } = _mangle.useMangleStore.call(void 0, );
1068
1101
  initMangle(mangle);
1069
1102
  const styleHandler = _postcss.createStyleHandler.call(void 0, {
@@ -3,12 +3,12 @@ import {
3
3
  } from "./chunk-Q67IXIAH.mjs";
4
4
  import {
5
5
  getDefaultOptions
6
- } from "./chunk-3YIQPUK7.mjs";
6
+ } from "./chunk-5BTC4YQI.mjs";
7
7
  import {
8
8
  defuOverrideArray,
9
9
  isMap,
10
10
  regExpTest
11
- } from "./chunk-JXBLHLFR.mjs";
11
+ } from "./chunk-Y5AFAYKI.mjs";
12
12
 
13
13
  // src/context/index.ts
14
14
  import { logger, pc } from "@weapp-tailwindcss/logger";
@@ -700,7 +700,7 @@ var Tokenizer = class {
700
700
  processChar(char, index) {
701
701
  switch (this.state) {
702
702
  case 0 /* START */:
703
- if (char === " ") {
703
+ if (this.isWhitespace(char)) {
704
704
  } else if (char === "{") {
705
705
  this.state = 2 /* OPEN_BRACE */;
706
706
  this.bufferStartIndex = index;
@@ -714,7 +714,7 @@ var Tokenizer = class {
714
714
  }
715
715
  break;
716
716
  case 1 /* TEXT */:
717
- if (char === " ") {
717
+ if (this.isWhitespace(char)) {
718
718
  this.tokens.push({ start: this.bufferStartIndex, end: index, value: this.buffer, expressions: this.expressions });
719
719
  this.buffer = "";
720
720
  this.expressions = [];
@@ -756,7 +756,7 @@ var Tokenizer = class {
756
756
  }
757
757
  break;
758
758
  case 4 /* BRACES_COMPLETE */:
759
- if (char === " ") {
759
+ if (this.isWhitespace(char)) {
760
760
  this.tokens.push({
761
761
  start: this.bufferStartIndex,
762
762
  end: index,
@@ -781,6 +781,7 @@ var Tokenizer = class {
781
781
  }
782
782
  }
783
783
  run(input) {
784
+ this.reset();
784
785
  for (let i = 0; i < input.length; i++) {
785
786
  const char = input[i];
786
787
  this.processChar(char, i);
@@ -793,7 +794,9 @@ var Tokenizer = class {
793
794
  expressions: this.expressions
794
795
  });
795
796
  }
796
- return this.tokens;
797
+ const result = this.tokens.slice();
798
+ this.reset();
799
+ return result;
797
800
  }
798
801
  reset() {
799
802
  this.state = 0 /* START */;
@@ -804,6 +807,9 @@ var Tokenizer = class {
804
807
  this.expressionStartIndex = 0;
805
808
  this.expressions = [];
806
809
  }
810
+ isWhitespace(char) {
811
+ return /\s/.test(char);
812
+ }
807
813
  };
808
814
 
809
815
  // src/wxml/utils.ts
@@ -848,7 +854,19 @@ function generateCode(match, options = {}) {
848
854
  }
849
855
  }
850
856
  function handleEachClassFragment(ms, tokens, options = {}) {
857
+ let previousEnd = 0;
851
858
  for (const token of tokens) {
859
+ if (token.start > previousEnd) {
860
+ const gap = ms.slice(previousEnd, token.start);
861
+ if (gap.trim() === "") {
862
+ ms.update(previousEnd, token.start, replaceWxml(gap, {
863
+ keepEOL: false,
864
+ escapeMap: options.escapeMap,
865
+ mangleContext: options.mangleContext,
866
+ ignoreHead: true
867
+ }));
868
+ }
869
+ }
852
870
  let p = token.start;
853
871
  if (token.expressions.length > 0) {
854
872
  for (const exp of token.expressions) {
@@ -882,6 +900,21 @@ function handleEachClassFragment(ms, tokens, options = {}) {
882
900
  ignoreHead: false
883
901
  }));
884
902
  }
903
+ previousEnd = token.end;
904
+ }
905
+ if (tokens.length > 0) {
906
+ const lastToken = tokens[tokens.length - 1];
907
+ if (lastToken.end < ms.original.length) {
908
+ const gap = ms.slice(lastToken.end, ms.original.length);
909
+ if (gap.trim() === "") {
910
+ ms.update(lastToken.end, ms.original.length, replaceWxml(gap, {
911
+ keepEOL: false,
912
+ escapeMap: options.escapeMap,
913
+ mangleContext: options.mangleContext,
914
+ ignoreHead: true
915
+ }));
916
+ }
917
+ }
885
918
  }
886
919
  }
887
920
  function templateReplacer(original, options = {}) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  noop
3
- } from "./chunk-JXBLHLFR.mjs";
3
+ } from "./chunk-Y5AFAYKI.mjs";
4
4
 
5
5
  // src/defaults.ts
6
6
  import { isAllowedClassName, MappingChars2String } from "@weapp-core/escape";
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/bundlers/webpack/BaseUnifiedPlugin/shared.ts
2
+ function getCacheKey(filename) {
3
+ return filename;
4
+ }
5
+
6
+
7
+
8
+ exports.getCacheKey = getCacheKey;
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
3
+ var _chunkQXQOYYCRjs = require('./chunk-QXQOYYCR.js');
4
4
 
5
5
  // src/defaults.ts
6
6
  var _escape = require('@weapp-core/escape');
@@ -77,11 +77,11 @@ function getDefaultOptions() {
77
77
  "border-color": "currentColor"
78
78
  },
79
79
  disabled: false,
80
- customRuleCallback: _chunkO335YLYHjs.noop,
81
- onLoad: _chunkO335YLYHjs.noop,
82
- onStart: _chunkO335YLYHjs.noop,
83
- onEnd: _chunkO335YLYHjs.noop,
84
- onUpdate: _chunkO335YLYHjs.noop,
80
+ customRuleCallback: _chunkQXQOYYCRjs.noop,
81
+ onLoad: _chunkQXQOYYCRjs.noop,
82
+ onStart: _chunkQXQOYYCRjs.noop,
83
+ onEnd: _chunkQXQOYYCRjs.noop,
84
+ onUpdate: _chunkQXQOYYCRjs.noop,
85
85
  customAttributes: {},
86
86
  customReplaceDictionary: _escape.MappingChars2String,
87
87
  appType: void 0,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3AUX4FGE.mjs";
4
4
  import {
5
5
  getCompilerContext
6
- } from "./chunk-DGVVFKNF.mjs";
6
+ } from "./chunk-3KXFKRIX.mjs";
7
7
 
8
8
  // src/bundlers/gulp/index.ts
9
9
  import { Buffer } from "buffer";
@@ -54,10 +54,6 @@ function createPlugins(options = {}) {
54
54
  }
55
55
  callback(error, file);
56
56
  }
57
- // construct(callback) {
58
- // debug('transformWxss start')
59
- // callback()
60
- // }
61
57
  });
62
58
  }
63
59
  function transformJs(options2 = {}) {
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  generateCode,
9
9
  getCompilerContext
10
- } from "./chunk-DGVVFKNF.mjs";
10
+ } from "./chunk-3KXFKRIX.mjs";
11
11
  import {
12
12
  replaceWxml
13
13
  } from "./chunk-Q67IXIAH.mjs";
14
14
  import {
15
15
  getGroupedEntries
16
- } from "./chunk-JXBLHLFR.mjs";
16
+ } from "./chunk-Y5AFAYKI.mjs";
17
17
 
18
18
  // src/bundlers/vite/index.ts
19
19
  import postcssHtmlTransform from "@weapp-tailwindcss/postcss/html-transform";
@@ -172,10 +172,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
172
172
  let runtimeSet;
173
173
  onLoad();
174
174
  const plugins = [
175
- // {
176
- // name: `${vitePluginName}:pre`,
177
- // enforce: 'pre',
178
- // },
179
175
  {
180
176
  name: `${vitePluginName}:post`,
181
177
  enforce: "post",
@@ -252,9 +248,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
252
248
  }
253
249
  },
254
250
  async () => {
255
- const { code } = await jsHandler(rawSource, runtimeSet, {
256
- // generateMap: hasSourceMap,
257
- });
251
+ const { code } = await jsHandler(rawSource, runtimeSet);
258
252
  originalSource.code = code;
259
253
  onUpdate(file, rawSource, code);
260
254
  debug("js handle: %s", file);
@@ -286,7 +280,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
286
280
  },
287
281
  async () => {
288
282
  const { code } = await jsHandler(rawSource, runtimeSet, {
289
- // generateMap: hasSourceMap,
290
283
  uniAppX,
291
284
  babelParserOptions: {
292
285
  plugins: [
@@ -375,8 +368,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
375
368
  // postcss may return virtual files
376
369
  // we cannot obtain content of them, so this needs to be enabled
377
370
  sourcesContent: true
378
- // when "prev: preprocessorMap", the result map may include duplicate filename in `postcssResult.map.sources`
379
- // prev: preprocessorMap,
371
+ // when a previous preprocessor map is provided, duplicates may appear in `postcssResult.map.sources`
380
372
  }
381
373
  }
382
374
  }
@@ -1,16 +1,18 @@
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(); } }
2
2
 
3
+ var _chunk6GP37C26js = require('./chunk-6GP37C26.js');
4
+
5
+
3
6
  var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
4
7
 
5
8
 
6
9
  var _chunkOGROHM4Ljs = require('./chunk-OGROHM4L.js');
7
10
 
8
11
 
9
- var _chunkGRWK73SMjs = require('./chunk-GRWK73SM.js');
12
+ var _chunk3KMEJ2LMjs = require('./chunk-3KMEJ2LM.js');
10
13
 
11
14
 
12
-
13
- var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
15
+ var _chunkQXQOYYCRjs = require('./chunk-QXQOYYCR.js');
14
16
 
15
17
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
16
18
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
@@ -18,7 +20,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
18
20
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
19
21
  var UnifiedWebpackPluginV5 = class {
20
22
  constructor(options = {}) {
21
- this.options = _chunkGRWK73SMjs.getCompilerContext.call(void 0, options);
23
+ this.options = _chunk3KMEJ2LMjs.getCompilerContext.call(void 0, options);
22
24
  this.appType = this.options.appType;
23
25
  }
24
26
  apply(compiler) {
@@ -82,7 +84,7 @@ var UnifiedWebpackPluginV5 = class {
82
84
  }
83
85
  }
84
86
  const entries = Object.entries(assets);
85
- const groupedEntries = _chunkO335YLYHjs.getGroupedEntries.call(void 0, entries, this.options);
87
+ const groupedEntries = _chunkQXQOYYCRjs.getGroupedEntries.call(void 0, entries, this.options);
86
88
  const runtimeSet = await twPatcher.getClassSet();
87
89
  setMangleRuntimeSet(runtimeSet);
88
90
  debug("get runtimeSet, class count: %d", runtimeSet.size);
@@ -126,7 +128,7 @@ var UnifiedWebpackPluginV5 = class {
126
128
  if (Array.isArray(groupedEntries.js)) {
127
129
  for (const element of groupedEntries.js) {
128
130
  const [file, originalSource] = element;
129
- const cacheKey = _chunkO335YLYHjs.removeExt.call(void 0, file);
131
+ const cacheKey = _chunk6GP37C26js.getCacheKey.call(void 0, file);
130
132
  promises.push(
131
133
  cache.process(
132
134
  cacheKey,
@@ -141,9 +143,7 @@ var UnifiedWebpackPluginV5 = class {
141
143
  },
142
144
  async () => {
143
145
  const rawSource = originalSource.source().toString();
144
- const { code } = await jsHandler(rawSource, runtimeSet, {
145
- // generateMap: hasMap,
146
- });
146
+ const { code } = await jsHandler(rawSource, runtimeSet);
147
147
  const source = new ConcatSource(code);
148
148
  compilation.updateAsset(file, source);
149
149
  onUpdate(file, rawSource, code);
@@ -1,4 +1,4 @@
1
- // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.5_jiti@2.5.1_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/esm_shims.js
1
+ // ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.5_jiti@2.6.0_postcss@8.5.6_tsx@4.20.6_typescript@5.9.2_yaml@2.8.1/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);
@@ -7,13 +7,13 @@ var _chunkOGROHM4Ljs = require('./chunk-OGROHM4L.js');
7
7
 
8
8
 
9
9
 
10
- var _chunkGRWK73SMjs = require('./chunk-GRWK73SM.js');
10
+ var _chunk3KMEJ2LMjs = require('./chunk-3KMEJ2LM.js');
11
11
 
12
12
 
13
13
  var _chunkPLMJW644js = require('./chunk-PLMJW644.js');
14
14
 
15
15
 
16
- var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
16
+ var _chunkQXQOYYCRjs = require('./chunk-QXQOYYCR.js');
17
17
 
18
18
  // src/bundlers/vite/index.ts
19
19
  var _htmltransform = require('@weapp-tailwindcss/postcss/html-transform'); var _htmltransform2 = _interopRequireDefault(_htmltransform);
@@ -51,7 +51,7 @@ function transformUVue(code, id, jsHandler, runtimeSet) {
51
51
  }
52
52
  if (prop.type === _compilerdom.NodeTypes.DIRECTIVE && prop.name === "bind" && _optionalChain([prop, 'access', _ => _.arg, 'optionalAccess', _2 => _2.type]) === _compilerdom.NodeTypes.SIMPLE_EXPRESSION && prop.arg.content === "class") {
53
53
  if (_optionalChain([prop, 'access', _3 => _3.exp, 'optionalAccess', _4 => _4.type]) === _compilerdom.NodeTypes.SIMPLE_EXPRESSION) {
54
- const code2 = _chunkGRWK73SMjs.generateCode.call(void 0, prop.exp.content, {
54
+ const code2 = _chunk3KMEJ2LMjs.generateCode.call(void 0, prop.exp.content, {
55
55
  jsHandler,
56
56
  runtimeSet
57
57
  });
@@ -148,7 +148,7 @@ async function formatPostcssSourceMap(rawMap, file) {
148
148
  // src/bundlers/vite/index.ts
149
149
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
150
150
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
151
- const opts = _chunkGRWK73SMjs.getCompilerContext.call(void 0, options);
151
+ const opts = _chunk3KMEJ2LMjs.getCompilerContext.call(void 0, options);
152
152
  const {
153
153
  disabled,
154
154
  onEnd,
@@ -172,10 +172,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
172
172
  let runtimeSet;
173
173
  onLoad();
174
174
  const plugins = [
175
- // {
176
- // name: `${vitePluginName}:pre`,
177
- // enforce: 'pre',
178
- // },
179
175
  {
180
176
  name: `${_chunkOGROHM4Ljs.vitePluginName}:post`,
181
177
  enforce: "post",
@@ -195,7 +191,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
195
191
  debug("start");
196
192
  onStart();
197
193
  const entries = Object.entries(bundle);
198
- const groupedEntries = _chunkO335YLYHjs.getGroupedEntries.call(void 0, entries, opts);
194
+ const groupedEntries = _chunkQXQOYYCRjs.getGroupedEntries.call(void 0, entries, opts);
199
195
  runtimeSet = await twPatcher.getClassSet();
200
196
  setMangleRuntimeSet(runtimeSet);
201
197
  debug("get runtimeSet, class count: %d", runtimeSet.size);
@@ -252,9 +248,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
252
248
  }
253
249
  },
254
250
  async () => {
255
- const { code } = await jsHandler(rawSource, runtimeSet, {
256
- // generateMap: hasSourceMap,
257
- });
251
+ const { code } = await jsHandler(rawSource, runtimeSet);
258
252
  originalSource.code = code;
259
253
  onUpdate(file, rawSource, code);
260
254
  debug("js handle: %s", file);
@@ -286,7 +280,6 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
286
280
  },
287
281
  async () => {
288
282
  const { code } = await jsHandler(rawSource, runtimeSet, {
289
- // generateMap: hasSourceMap,
290
283
  uniAppX,
291
284
  babelParserOptions: {
292
285
  plugins: [
@@ -375,8 +368,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
375
368
  // postcss may return virtual files
376
369
  // we cannot obtain content of them, so this needs to be enabled
377
370
  sourcesContent: true
378
- // when "prev: preprocessorMap", the result map may include duplicate filename in `postcssResult.map.sources`
379
- // prev: preprocessorMap,
371
+ // when a previous preprocessor map is provided, duplicates may appear in `postcssResult.map.sources`
380
372
  }
381
373
  }
382
374
  }
@@ -1,3 +1,6 @@
1
+ import {
2
+ getCacheKey
3
+ } from "./chunk-2F7HOQQY.mjs";
1
4
  import {
2
5
  createDebug
3
6
  } from "./chunk-3AUX4FGE.mjs";
@@ -6,14 +9,13 @@ import {
6
9
  } from "./chunk-CMUA5KCO.mjs";
7
10
  import {
8
11
  getCompilerContext
9
- } from "./chunk-DGVVFKNF.mjs";
12
+ } from "./chunk-3KXFKRIX.mjs";
10
13
  import {
11
- getGroupedEntries,
12
- removeExt
13
- } from "./chunk-JXBLHLFR.mjs";
14
+ getGroupedEntries
15
+ } from "./chunk-Y5AFAYKI.mjs";
14
16
  import {
15
17
  __dirname
16
- } from "./chunk-BXPTS6UP.mjs";
18
+ } from "./chunk-L36QGA7Y.mjs";
17
19
 
18
20
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
19
21
  import fs from "fs";
@@ -129,7 +131,7 @@ var UnifiedWebpackPluginV5 = class {
129
131
  if (Array.isArray(groupedEntries.js)) {
130
132
  for (const element of groupedEntries.js) {
131
133
  const [file, originalSource] = element;
132
- const cacheKey = removeExt(file);
134
+ const cacheKey = getCacheKey(file);
133
135
  promises.push(
134
136
  cache.process(
135
137
  cacheKey,
@@ -144,9 +146,7 @@ var UnifiedWebpackPluginV5 = class {
144
146
  },
145
147
  async () => {
146
148
  const rawSource = originalSource.source().toString();
147
- const { code } = await jsHandler(rawSource, runtimeSet, {
148
- // generateMap: hasMap,
149
- });
149
+ const { code } = await jsHandler(rawSource, runtimeSet);
150
150
  const source = new ConcatSource(code);
151
151
  compilation.updateAsset(file, source);
152
152
  onUpdate(file, rawSource, code);
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.5_jiti@2.5.1_postcss@8.5.6_tsx@4.20.5_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.5_jiti@2.6.0_postcss@8.5.6_tsx@4.20.6_typescript@5.9.2_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
2
2
  var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
3
3
  var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
4
4
 
@@ -23,5 +23,4 @@ function getGroupedEntries(entries, options) {
23
23
 
24
24
 
25
25
 
26
-
27
- exports.defu = _shared.defu; exports.defuOverrideArray = _shared.defuOverrideArray; exports.isMap = _shared.isMap; exports.noop = _shared.noop; exports.regExpTest = _shared.regExpTest; exports.removeExt = _shared.removeExt; exports.getGroupedEntries = getGroupedEntries;
26
+ exports.defu = _shared.defu; exports.defuOverrideArray = _shared.defuOverrideArray; exports.isMap = _shared.isMap; exports.noop = _shared.noop; exports.regExpTest = _shared.regExpTest; exports.getGroupedEntries = getGroupedEntries;
@@ -3,7 +3,7 @@
3
3
  var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
4
4
 
5
5
 
6
- var _chunkGRWK73SMjs = require('./chunk-GRWK73SM.js');
6
+ var _chunk3KMEJ2LMjs = require('./chunk-3KMEJ2LM.js');
7
7
 
8
8
  // src/bundlers/gulp/index.ts
9
9
  var _buffer = require('buffer');
@@ -11,7 +11,7 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
11
11
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
12
12
  var Transform = _stream2.default.Transform;
13
13
  function createPlugins(options = {}) {
14
- const opts = _chunkGRWK73SMjs.getCompilerContext.call(void 0, options);
14
+ const opts = _chunk3KMEJ2LMjs.getCompilerContext.call(void 0, options);
15
15
  const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
16
16
  let runtimeSet = /* @__PURE__ */ new Set();
17
17
  twPatcher.patch();
@@ -54,10 +54,6 @@ function createPlugins(options = {}) {
54
54
  }
55
55
  callback(error, file);
56
56
  }
57
- // construct(callback) {
58
- // debug('transformWxss start')
59
- // callback()
60
- // }
61
57
  });
62
58
  }
63
59
  function transformJs(options2 = {}) {
@@ -22,6 +22,5 @@ export {
22
22
  isMap,
23
23
  noop,
24
24
  regExpTest,
25
- removeExt,
26
25
  getGroupedEntries
27
26
  };