weapp-tailwindcss 4.1.5 → 4.1.6

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 (43) hide show
  1. package/css/rgb.css +268 -0
  2. package/css/uni-app-x/preflight.css +16 -0
  3. package/css/uni-app-x.css +4 -0
  4. package/css/weapp-theme.css +0 -0
  5. package/dist/{chunk-XRPBGBW5.mjs → chunk-2S365AJ6.mjs} +10 -5
  6. package/dist/{chunk-BOYBKFXU.mjs → chunk-7T4SM5CA.mjs} +2 -2
  7. package/dist/{chunk-YOYWDNJI.js → chunk-DIMGI7MP.js} +10 -5
  8. package/dist/chunk-E4KRP5NR.js +252 -0
  9. package/dist/{chunk-3LFHAVFB.mjs → chunk-I7I27B5D.mjs} +1 -1
  10. package/dist/chunk-JTKQH7XH.mjs +252 -0
  11. package/dist/chunk-OXASK55Q.js +6 -0
  12. package/dist/chunk-PMF2CCKK.mjs +6 -0
  13. package/dist/{chunk-J7NJDCHZ.js → chunk-QGBHJWZN.js} +2 -2
  14. package/dist/{chunk-GZNNW4A3.js → chunk-QINVU3VE.js} +3 -3
  15. package/dist/cli.js +6 -8
  16. package/dist/cli.mjs +4 -6
  17. package/dist/core.js +2 -2
  18. package/dist/core.mjs +1 -1
  19. package/dist/gulp.js +3 -3
  20. package/dist/gulp.mjs +2 -2
  21. package/dist/index.d.mts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +9 -5
  24. package/dist/index.mjs +10 -6
  25. package/dist/presets.d.mts +20 -0
  26. package/dist/presets.d.ts +20 -0
  27. package/dist/presets.js +49 -0
  28. package/dist/presets.mjs +49 -0
  29. package/dist/types.d.mts +8 -0
  30. package/dist/types.d.ts +8 -0
  31. package/dist/vite.d.mts +4 -2
  32. package/dist/vite.d.ts +4 -2
  33. package/dist/vite.js +7 -3
  34. package/dist/vite.mjs +8 -4
  35. package/dist/weapp-tw-runtime-loader.js +5 -28
  36. package/dist/webpack.js +3 -3
  37. package/dist/webpack.mjs +2 -2
  38. package/dist/webpack4.js +3 -3
  39. package/dist/webpack4.mjs +2 -2
  40. package/package.json +12 -3
  41. package/uni-app-x.css +1 -0
  42. package/dist/chunk-3C5J2G6C.js +0 -171
  43. package/dist/chunk-DNHAKEMA.mjs +0 -171
package/css/rgb.css ADDED
@@ -0,0 +1,268 @@
1
+ @theme {
2
+ --color-red-50: rgb(254, 242, 242);
3
+ --color-red-100: rgb(255, 226, 226);
4
+ --color-red-200: rgb(255, 201, 201);
5
+ --color-red-300: rgb(255, 162, 162);
6
+ --color-red-400: rgb(255, 100, 103);
7
+ --color-red-500: rgb(251, 44, 54);
8
+ --color-red-600: rgb(231, 0, 11);
9
+ --color-red-700: rgb(193, 0, 7);
10
+ --color-red-800: rgb(159, 7, 18);
11
+ --color-red-900: rgb(130, 24, 26);
12
+ --color-red-950: rgb(70, 8, 9);
13
+
14
+ --color-orange-50: rgb(255, 247, 237);
15
+ --color-orange-100: rgb(255, 237, 212);
16
+ --color-orange-200: rgb(255, 214, 167);
17
+ --color-orange-300: rgb(255, 184, 106);
18
+ --color-orange-400: rgb(255, 137, 4);
19
+ --color-orange-500: rgb(255, 105, 0);
20
+ --color-orange-600: rgb(245, 73, 0);
21
+ --color-orange-700: rgb(202, 53, 0);
22
+ --color-orange-800: rgb(159, 45, 0);
23
+ --color-orange-900: rgb(126, 42, 12);
24
+ --color-orange-950: rgb(68, 19, 6);
25
+
26
+ --color-amber-50: rgb(255, 251, 235);
27
+ --color-amber-100: rgb(254, 243, 198);
28
+ --color-amber-200: rgb(254, 230, 133);
29
+ --color-amber-300: rgb(255, 210, 48);
30
+ --color-amber-400: rgb(255, 185, 0);
31
+ --color-amber-500: rgb(254, 154, 0);
32
+ --color-amber-600: rgb(225, 113, 0);
33
+ --color-amber-700: rgb(187, 77, 0);
34
+ --color-amber-800: rgb(151, 60, 0);
35
+ --color-amber-900: rgb(123, 51, 6);
36
+ --color-amber-950: rgb(70, 25, 1);
37
+
38
+ --color-yellow-50: rgb(254, 252, 232);
39
+ --color-yellow-100: rgb(254, 249, 194);
40
+ --color-yellow-200: rgb(255, 240, 133);
41
+ --color-yellow-300: rgb(255, 223, 32);
42
+ --color-yellow-400: rgb(253, 199, 0);
43
+ --color-yellow-500: rgb(240, 177, 0);
44
+ --color-yellow-600: rgb(208, 135, 0);
45
+ --color-yellow-700: rgb(166, 95, 0);
46
+ --color-yellow-800: rgb(137, 75, 0);
47
+ --color-yellow-900: rgb(115, 62, 10);
48
+ --color-yellow-950: rgb(67, 32, 4);
49
+
50
+ --color-lime-50: rgb(247, 254, 231);
51
+ --color-lime-100: rgb(236, 252, 202);
52
+ --color-lime-200: rgb(216, 249, 153);
53
+ --color-lime-300: rgb(187, 244, 81);
54
+ --color-lime-400: rgb(154, 230, 0);
55
+ --color-lime-500: rgb(124, 207, 0);
56
+ --color-lime-600: rgb(94, 165, 0);
57
+ --color-lime-700: rgb(73, 125, 0);
58
+ --color-lime-800: rgb(60, 99, 0);
59
+ --color-lime-900: rgb(53, 83, 14);
60
+ --color-lime-950: rgb(25, 46, 3);
61
+
62
+ --color-green-50: rgb(240, 253, 244);
63
+ --color-green-100: rgb(220, 252, 231);
64
+ --color-green-200: rgb(185, 248, 207);
65
+ --color-green-300: rgb(123, 241, 168);
66
+ --color-green-400: rgb(5, 223, 114);
67
+ --color-green-500: rgb(0, 201, 80);
68
+ --color-green-600: rgb(0, 166, 62);
69
+ --color-green-700: rgb(0, 130, 54);
70
+ --color-green-800: rgb(1, 102, 48);
71
+ --color-green-900: rgb(13, 84, 43);
72
+ --color-green-950: rgb(3, 46, 21);
73
+
74
+ --color-emerald-50: rgb(236, 253, 245);
75
+ --color-emerald-100: rgb(208, 250, 229);
76
+ --color-emerald-200: rgb(164, 244, 207);
77
+ --color-emerald-300: rgb(94, 233, 181);
78
+ --color-emerald-400: rgb(0, 212, 146);
79
+ --color-emerald-500: rgb(0, 188, 125);
80
+ --color-emerald-600: rgb(0, 153, 102);
81
+ --color-emerald-700: rgb(0, 122, 85);
82
+ --color-emerald-800: rgb(0, 96, 69);
83
+ --color-emerald-900: rgb(0, 79, 59);
84
+ --color-emerald-950: rgb(0, 44, 34);
85
+
86
+ --color-teal-50: rgb(240, 253, 250);
87
+ --color-teal-100: rgb(203, 251, 241);
88
+ --color-teal-200: rgb(150, 247, 228);
89
+ --color-teal-300: rgb(70, 236, 213);
90
+ --color-teal-400: rgb(0, 213, 190);
91
+ --color-teal-500: rgb(0, 187, 167);
92
+ --color-teal-600: rgb(0, 150, 137);
93
+ --color-teal-700: rgb(0, 120, 111);
94
+ --color-teal-800: rgb(0, 95, 90);
95
+ --color-teal-900: rgb(11, 79, 74);
96
+ --color-teal-950: rgb(2, 47, 46);
97
+
98
+ --color-cyan-50: rgb(236, 254, 255);
99
+ --color-cyan-100: rgb(206, 250, 254);
100
+ --color-cyan-200: rgb(162, 244, 253);
101
+ --color-cyan-300: rgb(83, 234, 253);
102
+ --color-cyan-400: rgb(0, 211, 242);
103
+ --color-cyan-500: rgb(0, 184, 219);
104
+ --color-cyan-600: rgb(0, 146, 184);
105
+ --color-cyan-700: rgb(0, 117, 149);
106
+ --color-cyan-800: rgb(0, 95, 120);
107
+ --color-cyan-900: rgb(16, 78, 100);
108
+ --color-cyan-950: rgb(5, 51, 69);
109
+
110
+ --color-sky-50: rgb(240, 249, 255);
111
+ --color-sky-100: rgb(223, 242, 254);
112
+ --color-sky-200: rgb(184, 230, 254);
113
+ --color-sky-300: rgb(116, 212, 255);
114
+ --color-sky-400: rgb(0, 188, 255);
115
+ --color-sky-500: rgb(0, 166, 244);
116
+ --color-sky-600: rgb(0, 132, 209);
117
+ --color-sky-700: rgb(0, 105, 168);
118
+ --color-sky-800: rgb(0, 89, 138);
119
+ --color-sky-900: rgb(2, 74, 112);
120
+ --color-sky-950: rgb(5, 47, 74);
121
+
122
+ --color-blue-50: rgb(239, 246, 255);
123
+ --color-blue-100: rgb(219, 234, 254);
124
+ --color-blue-200: rgb(190, 219, 255);
125
+ --color-blue-300: rgb(142, 197, 255);
126
+ --color-blue-400: rgb(81, 162, 255);
127
+ --color-blue-500: rgb(43, 127, 255);
128
+ --color-blue-600: rgb(21, 93, 252);
129
+ --color-blue-700: rgb(20, 71, 230);
130
+ --color-blue-800: rgb(25, 60, 184);
131
+ --color-blue-900: rgb(28, 57, 142);
132
+ --color-blue-950: rgb(22, 36, 86);
133
+
134
+ --color-indigo-50: rgb(238, 242, 255);
135
+ --color-indigo-100: rgb(224, 231, 255);
136
+ --color-indigo-200: rgb(198, 210, 255);
137
+ --color-indigo-300: rgb(163, 179, 255);
138
+ --color-indigo-400: rgb(124, 134, 255);
139
+ --color-indigo-500: rgb(97, 95, 255);
140
+ --color-indigo-600: rgb(79, 57, 246);
141
+ --color-indigo-700: rgb(67, 45, 215);
142
+ --color-indigo-800: rgb(55, 42, 172);
143
+ --color-indigo-900: rgb(49, 44, 133);
144
+ --color-indigo-950: rgb(30, 26, 77);
145
+
146
+ --color-violet-50: rgb(245, 243, 255);
147
+ --color-violet-100: rgb(237, 233, 254);
148
+ --color-violet-200: rgb(221, 214, 255);
149
+ --color-violet-300: rgb(196, 180, 255);
150
+ --color-violet-400: rgb(166, 132, 255);
151
+ --color-violet-500: rgb(142, 81, 255);
152
+ --color-violet-600: rgb(127, 34, 254);
153
+ --color-violet-700: rgb(112, 8, 231);
154
+ --color-violet-800: rgb(93, 14, 192);
155
+ --color-violet-900: rgb(77, 23, 154);
156
+ --color-violet-950: rgb(47, 13, 104);
157
+
158
+ --color-purple-50: rgb(250, 245, 255);
159
+ --color-purple-100: rgb(243, 232, 255);
160
+ --color-purple-200: rgb(233, 212, 255);
161
+ --color-purple-300: rgb(218, 178, 255);
162
+ --color-purple-400: rgb(194, 122, 255);
163
+ --color-purple-500: rgb(173, 70, 255);
164
+ --color-purple-600: rgb(152, 16, 250);
165
+ --color-purple-700: rgb(130, 0, 219);
166
+ --color-purple-800: rgb(110, 17, 176);
167
+ --color-purple-900: rgb(89, 22, 139);
168
+ --color-purple-950: rgb(60, 3, 102);
169
+
170
+ --color-fuchsia-50: rgb(253, 244, 255);
171
+ --color-fuchsia-100: rgb(250, 232, 255);
172
+ --color-fuchsia-200: rgb(246, 207, 255);
173
+ --color-fuchsia-300: rgb(244, 168, 255);
174
+ --color-fuchsia-400: rgb(237, 106, 255);
175
+ --color-fuchsia-500: rgb(225, 42, 251);
176
+ --color-fuchsia-600: rgb(200, 0, 222);
177
+ --color-fuchsia-700: rgb(168, 0, 183);
178
+ --color-fuchsia-800: rgb(138, 1, 148);
179
+ --color-fuchsia-900: rgb(114, 19, 120);
180
+ --color-fuchsia-950: rgb(75, 0, 79);
181
+
182
+ --color-pink-50: rgb(253, 242, 248);
183
+ --color-pink-100: rgb(252, 231, 243);
184
+ --color-pink-200: rgb(252, 206, 232);
185
+ --color-pink-300: rgb(253, 165, 213);
186
+ --color-pink-400: rgb(251, 100, 182);
187
+ --color-pink-500: rgb(246, 51, 154);
188
+ --color-pink-600: rgb(230, 0, 118);
189
+ --color-pink-700: rgb(198, 0, 92);
190
+ --color-pink-800: rgb(163, 0, 76);
191
+ --color-pink-900: rgb(134, 16, 67);
192
+ --color-pink-950: rgb(81, 4, 36);
193
+
194
+ --color-rose-50: rgb(255, 241, 242);
195
+ --color-rose-100: rgb(255, 228, 230);
196
+ --color-rose-200: rgb(255, 204, 211);
197
+ --color-rose-300: rgb(255, 161, 173);
198
+ --color-rose-400: rgb(255, 99, 126);
199
+ --color-rose-500: rgb(255, 32, 86);
200
+ --color-rose-600: rgb(236, 0, 63);
201
+ --color-rose-700: rgb(199, 0, 54);
202
+ --color-rose-800: rgb(165, 0, 54);
203
+ --color-rose-900: rgb(139, 8, 54);
204
+ --color-rose-950: rgb(77, 2, 24);
205
+
206
+ --color-slate-50: rgb(248, 250, 252);
207
+ --color-slate-100: rgb(241, 245, 249);
208
+ --color-slate-200: rgb(226, 232, 240);
209
+ --color-slate-300: rgb(202, 213, 226);
210
+ --color-slate-400: rgb(144, 161, 185);
211
+ --color-slate-500: rgb(98, 116, 142);
212
+ --color-slate-600: rgb(69, 85, 108);
213
+ --color-slate-700: rgb(49, 65, 88);
214
+ --color-slate-800: rgb(29, 41, 61);
215
+ --color-slate-900: rgb(15, 23, 43);
216
+ --color-slate-950: rgb(2, 6, 24);
217
+
218
+ --color-gray-50: rgb(249, 250, 251);
219
+ --color-gray-100: rgb(243, 244, 246);
220
+ --color-gray-200: rgb(229, 231, 235);
221
+ --color-gray-300: rgb(209, 213, 220);
222
+ --color-gray-400: rgb(153, 161, 175);
223
+ --color-gray-500: rgb(106, 114, 130);
224
+ --color-gray-600: rgb(74, 85, 101);
225
+ --color-gray-700: rgb(54, 65, 83);
226
+ --color-gray-800: rgb(30, 41, 57);
227
+ --color-gray-900: rgb(16, 24, 40);
228
+ --color-gray-950: rgb(3, 7, 18);
229
+
230
+ --color-zinc-50: rgb(250, 250, 250);
231
+ --color-zinc-100: rgb(244, 244, 245);
232
+ --color-zinc-200: rgb(228, 228, 231);
233
+ --color-zinc-300: rgb(212, 212, 216);
234
+ --color-zinc-400: rgb(159, 159, 169);
235
+ --color-zinc-500: rgb(113, 113, 123);
236
+ --color-zinc-600: rgb(82, 82, 92);
237
+ --color-zinc-700: rgb(63, 63, 70);
238
+ --color-zinc-800: rgb(39, 39, 42);
239
+ --color-zinc-900: rgb(24, 24, 27);
240
+ --color-zinc-950: rgb(9, 9, 11);
241
+
242
+ --color-neutral-50: rgb(250, 250, 250);
243
+ --color-neutral-100: rgb(245, 245, 245);
244
+ --color-neutral-200: rgb(229, 229, 229);
245
+ --color-neutral-300: rgb(212, 212, 212);
246
+ --color-neutral-400: rgb(161, 161, 161);
247
+ --color-neutral-500: rgb(115, 115, 115);
248
+ --color-neutral-600: rgb(82, 82, 82);
249
+ --color-neutral-700: rgb(64, 64, 64);
250
+ --color-neutral-800: rgb(38, 38, 38);
251
+ --color-neutral-900: rgb(23, 23, 23);
252
+ --color-neutral-950: rgb(10, 10, 10);
253
+
254
+ --color-stone-50: rgb(250, 250, 249);
255
+ --color-stone-100: rgb(245, 245, 244);
256
+ --color-stone-200: rgb(231, 229, 228);
257
+ --color-stone-300: rgb(214, 211, 209);
258
+ --color-stone-400: rgb(166, 160, 155);
259
+ --color-stone-500: rgb(121, 113, 107);
260
+ --color-stone-600: rgb(87, 83, 77);
261
+ --color-stone-700: rgb(68, 64, 59);
262
+ --color-stone-800: rgb(41, 37, 36);
263
+ --color-stone-900: rgb(28, 25, 23);
264
+ --color-stone-950: rgb(12, 10, 9);
265
+
266
+ --color-black: #000;
267
+ --color-white: #fff;
268
+ }
@@ -0,0 +1,16 @@
1
+ /*
2
+ 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
3
+ 2. Remove default margins and padding
4
+ 3. Reset all borders.
5
+ */
6
+
7
+ *,
8
+ ::after,
9
+ ::before {
10
+ box-sizing: border-box;
11
+ /* 1 */
12
+ margin: 0;
13
+ /* 2 */
14
+ padding: 0;
15
+ /* 2 */
16
+ }
@@ -0,0 +1,4 @@
1
+ @import './theme.css';
2
+ @import './rgb.css';
3
+ /* @import './uni-app-x/preflight.css'; */
4
+ @import './utilities.css';
File without changes
@@ -620,7 +620,8 @@ function createJsHandler(options) {
620
620
  generateMap,
621
621
  babelParserOptions,
622
622
  ignoreCallExpressionIdentifiers,
623
- ignoreTaggedTemplateExpressionIdentifiers
623
+ ignoreTaggedTemplateExpressionIdentifiers,
624
+ uniAppX
624
625
  } = options;
625
626
  function handler(rawSource, classNameSet, options2) {
626
627
  const opts = defuOverrideArray(options2, {
@@ -632,7 +633,8 @@ function createJsHandler(options) {
632
633
  generateMap,
633
634
  babelParserOptions,
634
635
  ignoreCallExpressionIdentifiers,
635
- ignoreTaggedTemplateExpressionIdentifiers
636
+ ignoreTaggedTemplateExpressionIdentifiers,
637
+ uniAppX
636
638
  });
637
639
  return jsHandler(rawSource, opts);
638
640
  }
@@ -1022,7 +1024,8 @@ function getCompilerContext(opts) {
1022
1024
  ignoreTaggedTemplateExpressionIdentifiers,
1023
1025
  cssPresetEnv,
1024
1026
  tailwindcss,
1025
- tailwindcssPatcherOptions
1027
+ tailwindcssPatcherOptions,
1028
+ uniAppX
1026
1029
  } = ctx;
1027
1030
  const customAttributesEntities = isMap(customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
1028
1031
  const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
@@ -1040,7 +1043,8 @@ function getCompilerContext(opts) {
1040
1043
  postcssOptions,
1041
1044
  cssRemoveProperty,
1042
1045
  cssRemoveHoverPseudoClass,
1043
- cssPresetEnv
1046
+ cssPresetEnv,
1047
+ uniAppX
1044
1048
  });
1045
1049
  const jsHandler2 = createJsHandler({
1046
1050
  escapeMap,
@@ -1050,7 +1054,8 @@ function getCompilerContext(opts) {
1050
1054
  generateMap: true,
1051
1055
  babelParserOptions,
1052
1056
  ignoreCallExpressionIdentifiers,
1053
- ignoreTaggedTemplateExpressionIdentifiers
1057
+ ignoreTaggedTemplateExpressionIdentifiers,
1058
+ uniAppX
1054
1059
  });
1055
1060
  const templateHandler = createTemplateHandler({
1056
1061
  customAttributesEntities,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-CMUA5KCO.mjs";
7
7
  import {
8
8
  getCompilerContext
9
- } from "./chunk-XRPBGBW5.mjs";
9
+ } from "./chunk-2S365AJ6.mjs";
10
10
  import {
11
11
  getGroupedEntries,
12
12
  removeExt
@@ -48,7 +48,7 @@ var UnifiedWebpackPluginV5 = class {
48
48
  const { ConcatSource, RawSource } = sources;
49
49
  function getClassSetInLoader() {
50
50
  if (twPatcher.majorVersion !== 4) {
51
- return twPatcher.getClassSet();
51
+ return twPatcher.getClassSetV3();
52
52
  }
53
53
  }
54
54
  onLoad();
@@ -623,7 +623,8 @@ function createJsHandler(options) {
623
623
  generateMap,
624
624
  babelParserOptions,
625
625
  ignoreCallExpressionIdentifiers,
626
- ignoreTaggedTemplateExpressionIdentifiers
626
+ ignoreTaggedTemplateExpressionIdentifiers,
627
+ uniAppX
627
628
  } = options;
628
629
  function handler(rawSource, classNameSet, options2) {
629
630
  const opts = _chunkO335YLYHjs.defuOverrideArray.call(void 0, options2, {
@@ -635,7 +636,8 @@ function createJsHandler(options) {
635
636
  generateMap,
636
637
  babelParserOptions,
637
638
  ignoreCallExpressionIdentifiers,
638
- ignoreTaggedTemplateExpressionIdentifiers
639
+ ignoreTaggedTemplateExpressionIdentifiers,
640
+ uniAppX
639
641
  });
640
642
  return jsHandler(rawSource, opts);
641
643
  }
@@ -1025,7 +1027,8 @@ function getCompilerContext(opts) {
1025
1027
  ignoreTaggedTemplateExpressionIdentifiers,
1026
1028
  cssPresetEnv,
1027
1029
  tailwindcss,
1028
- tailwindcssPatcherOptions
1030
+ tailwindcssPatcherOptions,
1031
+ uniAppX
1029
1032
  } = ctx;
1030
1033
  const customAttributesEntities = _chunkO335YLYHjs.isMap.call(void 0, customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
1031
1034
  const { initMangle, mangleContext, setMangleRuntimeSet } = _mangle.useMangleStore.call(void 0, );
@@ -1043,7 +1046,8 @@ function getCompilerContext(opts) {
1043
1046
  postcssOptions,
1044
1047
  cssRemoveProperty,
1045
1048
  cssRemoveHoverPseudoClass,
1046
- cssPresetEnv
1049
+ cssPresetEnv,
1050
+ uniAppX
1047
1051
  });
1048
1052
  const jsHandler2 = createJsHandler({
1049
1053
  escapeMap,
@@ -1053,7 +1057,8 @@ function getCompilerContext(opts) {
1053
1057
  generateMap: true,
1054
1058
  babelParserOptions,
1055
1059
  ignoreCallExpressionIdentifiers,
1056
- ignoreTaggedTemplateExpressionIdentifiers
1060
+ ignoreTaggedTemplateExpressionIdentifiers,
1061
+ uniAppX
1057
1062
  });
1058
1063
  const templateHandler = createTemplateHandler({
1059
1064
  customAttributesEntities,
@@ -0,0 +1,252 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
4
+
5
+
6
+ var _chunkOGROHM4Ljs = require('./chunk-OGROHM4L.js');
7
+
8
+
9
+ var _chunkDIMGI7MPjs = require('./chunk-DIMGI7MP.js');
10
+
11
+
12
+ var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
13
+
14
+ // src/bundlers/vite/index.ts
15
+ var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
16
+ var cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
17
+ var cssLangRE = new RegExp(cssLangs);
18
+ function isCSSRequest(request) {
19
+ return cssLangRE.test(request);
20
+ }
21
+ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
22
+ const opts = _chunkDIMGI7MPjs.getCompilerContext.call(void 0, options);
23
+ const {
24
+ disabled,
25
+ onEnd,
26
+ onLoad,
27
+ onStart,
28
+ onUpdate,
29
+ templateHandler,
30
+ styleHandler,
31
+ jsHandler,
32
+ mainCssChunkMatcher,
33
+ appType,
34
+ setMangleRuntimeSet,
35
+ cache,
36
+ twPatcher,
37
+ uniAppX
38
+ } = opts;
39
+ if (disabled) {
40
+ return;
41
+ }
42
+ twPatcher.patch();
43
+ onLoad();
44
+ const plugins = [
45
+ {
46
+ name: _chunkOGROHM4Ljs.vitePluginName,
47
+ enforce: "post",
48
+ async generateBundle(_opt, bundle) {
49
+ debug("start");
50
+ onStart();
51
+ const entries = Object.entries(bundle);
52
+ const groupedEntries = _chunkO335YLYHjs.getGroupedEntries.call(void 0, entries, opts);
53
+ const runtimeSet = await twPatcher.getClassSet();
54
+ setMangleRuntimeSet(runtimeSet);
55
+ debug("get runtimeSet, class count: %d", runtimeSet.size);
56
+ const promises = [];
57
+ if (Array.isArray(groupedEntries.html)) {
58
+ for (const element of groupedEntries.html) {
59
+ const [file, originalSource] = element;
60
+ const oldVal = originalSource.source.toString();
61
+ const hash = cache.computeHash(oldVal);
62
+ cache.calcHashValueChanged(file, hash);
63
+ promises.push(
64
+ cache.process(
65
+ file,
66
+ () => {
67
+ const source = cache.get(file);
68
+ if (source) {
69
+ originalSource.source = source;
70
+ debug("html cache hit: %s", file);
71
+ } else {
72
+ return false;
73
+ }
74
+ },
75
+ async () => {
76
+ originalSource.source = await templateHandler(oldVal, {
77
+ runtimeSet
78
+ });
79
+ onUpdate(file, oldVal, originalSource.source);
80
+ debug("html handle: %s", file);
81
+ return {
82
+ key: file,
83
+ source: originalSource.source
84
+ };
85
+ }
86
+ )
87
+ );
88
+ }
89
+ }
90
+ if (Array.isArray(groupedEntries.js)) {
91
+ for (const element of groupedEntries.js.filter((x) => x[1].type === "chunk")) {
92
+ const [file, originalSource] = element;
93
+ const rawSource = originalSource.code;
94
+ const hash = cache.computeHash(rawSource);
95
+ cache.calcHashValueChanged(file, hash);
96
+ promises.push(
97
+ cache.process(
98
+ file,
99
+ () => {
100
+ const source = cache.get(file);
101
+ if (source) {
102
+ originalSource.code = source;
103
+ debug("js cache hit: %s", file);
104
+ } else {
105
+ return false;
106
+ }
107
+ },
108
+ async () => {
109
+ const mapFilename = `${file}.map`;
110
+ const hasSourceMap = Boolean(bundle[mapFilename]);
111
+ const { code, map } = await jsHandler(rawSource, runtimeSet, {
112
+ generateMap: hasSourceMap
113
+ });
114
+ originalSource.code = code;
115
+ onUpdate(file, rawSource, code);
116
+ debug("js handle: %s", file);
117
+ if (hasSourceMap && map) {
118
+ ;
119
+ bundle[mapFilename].source = map.toString();
120
+ }
121
+ return {
122
+ key: file,
123
+ source: code
124
+ };
125
+ }
126
+ )
127
+ );
128
+ }
129
+ if (uniAppX) {
130
+ for (const element of groupedEntries.js.filter((x) => x[1].type === "asset")) {
131
+ const [file, originalSource] = element;
132
+ const rawSource = originalSource.source.toString();
133
+ const hash = cache.computeHash(rawSource);
134
+ cache.calcHashValueChanged(file, hash);
135
+ promises.push(
136
+ cache.process(
137
+ file,
138
+ () => {
139
+ const source = cache.get(file);
140
+ if (source) {
141
+ originalSource.source = source;
142
+ debug("js cache hit: %s", file);
143
+ } else {
144
+ return false;
145
+ }
146
+ },
147
+ async () => {
148
+ const mapFilename = `${file}.map`;
149
+ const hasSourceMap = Boolean(bundle[mapFilename]);
150
+ const { code, map } = await jsHandler(rawSource, runtimeSet, {
151
+ generateMap: hasSourceMap,
152
+ uniAppX,
153
+ babelParserOptions: {
154
+ plugins: [
155
+ "typescript"
156
+ ],
157
+ sourceType: "unambiguous"
158
+ }
159
+ });
160
+ originalSource.source = code;
161
+ onUpdate(file, rawSource, code);
162
+ debug("js handle: %s", file);
163
+ if (hasSourceMap && map) {
164
+ ;
165
+ bundle[mapFilename].source = map.toString();
166
+ }
167
+ return {
168
+ key: file,
169
+ source: code
170
+ };
171
+ }
172
+ )
173
+ );
174
+ }
175
+ }
176
+ }
177
+ if (Array.isArray(groupedEntries.css)) {
178
+ for (const element of groupedEntries.css) {
179
+ const [file, originalSource] = element;
180
+ const rawSource = originalSource.source.toString();
181
+ const hash = cache.computeHash(rawSource);
182
+ cache.calcHashValueChanged(file, hash);
183
+ promises.push(
184
+ cache.process(
185
+ file,
186
+ () => {
187
+ const source = cache.get(file);
188
+ if (source) {
189
+ originalSource.source = source;
190
+ debug("css cache hit: %s", file);
191
+ } else {
192
+ return false;
193
+ }
194
+ },
195
+ async () => {
196
+ const { css } = await styleHandler(rawSource, {
197
+ isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType),
198
+ postcssOptions: {
199
+ options: {
200
+ from: file
201
+ }
202
+ }
203
+ });
204
+ originalSource.source = css;
205
+ onUpdate(file, rawSource, css);
206
+ debug("css handle: %s", file);
207
+ return {
208
+ key: file,
209
+ source: css
210
+ };
211
+ }
212
+ )
213
+ );
214
+ }
215
+ }
216
+ await Promise.all(promises);
217
+ onEnd();
218
+ debug("end");
219
+ }
220
+ }
221
+ ];
222
+ if (uniAppX) {
223
+ plugins.push(
224
+ {
225
+ name: "weapp-tailwindcss:uni-app-x:css",
226
+ async transform(code, id) {
227
+ if (isCSSRequest(id)) {
228
+ const { css } = await styleHandler(code, {
229
+ isMainChunk: mainCssChunkMatcher(id, appType),
230
+ postcssOptions: {
231
+ options: {
232
+ from: id
233
+ }
234
+ }
235
+ });
236
+ return {
237
+ code: css
238
+ // map,
239
+ };
240
+ }
241
+ }
242
+ }
243
+ );
244
+ }
245
+ return plugins;
246
+ }
247
+
248
+
249
+
250
+
251
+
252
+ exports.cssLangRE = cssLangRE; exports.isCSSRequest = isCSSRequest; exports.UnifiedViteWeappTailwindcssPlugin = UnifiedViteWeappTailwindcssPlugin;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3AUX4FGE.mjs";
4
4
  import {
5
5
  getCompilerContext
6
- } from "./chunk-XRPBGBW5.mjs";
6
+ } from "./chunk-2S365AJ6.mjs";
7
7
 
8
8
  // src/bundlers/gulp/index.ts
9
9
  import { Buffer } from "node:buffer";