weapp-tailwindcss 4.10.3 → 4.11.0-alpha.1

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 (64) hide show
  1. package/dist/{chunk-3XVUGMTY.mjs → chunk-2LH6PZH3.mjs} +8 -4
  2. package/dist/{chunk-3WUHHFLF.mjs → chunk-35EI5JMK.mjs} +4 -2
  3. package/dist/{chunk-RYC23C3K.js → chunk-4LPOQMFS.js} +203 -198
  4. package/dist/{chunk-5U24PLVV.js → chunk-ACTJYB33.js} +4 -2
  5. package/dist/chunk-CZLXTEHN.js +1936 -0
  6. package/dist/{chunk-TNYEOBAC.mjs → chunk-DOH7FULQ.mjs} +1 -1
  7. package/dist/{chunk-E7775SFS.mjs → chunk-FZNYV7VH.mjs} +914 -334
  8. package/dist/{chunk-6Z4GEN2Y.js → chunk-G3G437UE.js} +2 -2
  9. package/dist/{chunk-DEIJXHGJ.js → chunk-G5NLM3AL.js} +978 -398
  10. package/dist/{chunk-W2N6G2QQ.js → chunk-GWDHNCL2.js} +60 -46
  11. package/dist/{chunk-QOTLDKI4.mjs → chunk-IEZ5RBMG.mjs} +197 -192
  12. package/dist/{chunk-RM3SY4S4.mjs → chunk-JBM3HGHP.mjs} +52 -12
  13. package/dist/{chunk-WXT2GI5R.mjs → chunk-KKT2DKMW.mjs} +30 -16
  14. package/dist/chunk-LD7LZ4IK.mjs +1933 -0
  15. package/dist/{chunk-GCRL3ZYP.js → chunk-NOKJXG3W.js} +5 -5
  16. package/dist/{chunk-YUTKX7JZ.js → chunk-OV7FX6XR.js} +1 -1
  17. package/dist/{chunk-SR4GC2F4.js → chunk-OYSABARD.js} +8 -4
  18. package/dist/{chunk-LICQ6EGN.mjs → chunk-QYZCRG7F.mjs} +2 -2
  19. package/dist/{chunk-UYTCZXNE.mjs → chunk-R6KEYO3F.mjs} +6 -5
  20. package/dist/{chunk-WF636Q5E.js → chunk-SQG2MOFQ.js} +10 -9
  21. package/dist/{chunk-L7OBNTRI.js → chunk-W2EMGF7H.js} +57 -17
  22. package/dist/cli.js +45 -42
  23. package/dist/cli.mjs +9 -6
  24. package/dist/core.d.mts +4 -3
  25. package/dist/core.d.ts +4 -3
  26. package/dist/core.js +124 -30
  27. package/dist/core.mjs +119 -25
  28. package/dist/css-macro/postcss.js +6 -5
  29. package/dist/css-macro/postcss.mjs +4 -3
  30. package/dist/css-macro.js +5 -5
  31. package/dist/css-macro.mjs +2 -2
  32. package/dist/defaults.js +3 -3
  33. package/dist/defaults.mjs +2 -2
  34. package/dist/escape.js +2 -1
  35. package/dist/escape.mjs +2 -1
  36. package/dist/gulp.d.mts +1 -1
  37. package/dist/gulp.d.ts +1 -1
  38. package/dist/gulp.js +8 -7
  39. package/dist/gulp.mjs +8 -7
  40. package/dist/index.js +11 -11
  41. package/dist/index.mjs +9 -9
  42. package/dist/postcss-html-transform.js +1 -1
  43. package/dist/postcss-html-transform.mjs +1 -1
  44. package/dist/presets.js +5 -5
  45. package/dist/presets.mjs +2 -2
  46. package/dist/reset.js +1 -1
  47. package/dist/reset.mjs +1 -1
  48. package/dist/types.js +1 -1
  49. package/dist/types.mjs +1 -1
  50. package/dist/vite.d.mts +1 -1
  51. package/dist/vite.d.ts +1 -1
  52. package/dist/vite.js +9 -8
  53. package/dist/vite.mjs +8 -7
  54. package/dist/webpack.d.mts +1 -1
  55. package/dist/webpack.d.ts +1 -1
  56. package/dist/webpack.js +10 -9
  57. package/dist/webpack.mjs +8 -7
  58. package/dist/webpack4.d.mts +1 -1
  59. package/dist/webpack4.d.ts +1 -1
  60. package/dist/webpack4.js +64 -49
  61. package/dist/webpack4.mjs +33 -18
  62. package/package.json +7 -7
  63. package/dist/chunk-PALDKVKG.mjs +0 -1291
  64. package/dist/chunk-YJSFFRNZ.js +0 -1291
@@ -10,7 +10,7 @@ import {
10
10
  isMpx,
11
11
  patchMpxLoaderResolve,
12
12
  setupMpxTailwindcssRedirect
13
- } from "./chunk-UYTCZXNE.mjs";
13
+ } from "./chunk-R6KEYO3F.mjs";
14
14
  import {
15
15
  pushConcurrentTaskFactories,
16
16
  resolveDisabledOptions,
@@ -23,20 +23,20 @@ import {
23
23
  } from "./chunk-RRHPTTCP.mjs";
24
24
  import {
25
25
  setupPatchRecorder
26
- } from "./chunk-LICQ6EGN.mjs";
26
+ } from "./chunk-QYZCRG7F.mjs";
27
27
  import {
28
28
  createDebug,
29
29
  ensureRuntimeClassSet,
30
30
  getCompilerContext,
31
31
  getRuntimeClassSetSignature,
32
32
  pluginName
33
- } from "./chunk-E7775SFS.mjs";
33
+ } from "./chunk-FZNYV7VH.mjs";
34
34
  import {
35
35
  getGroupedEntries
36
36
  } from "./chunk-OOHJLO5M.mjs";
37
37
  import {
38
38
  __dirname
39
- } from "./chunk-TNYEOBAC.mjs";
39
+ } from "./chunk-DOH7FULQ.mjs";
40
40
 
41
41
  // src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
42
42
  import process3 from "process";
@@ -60,6 +60,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
60
60
  } = options;
61
61
  const { Compilation, sources } = compiler.webpack;
62
62
  const { ConcatSource } = sources;
63
+ const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
63
64
  compiler.hooks.compilation.tap(pluginName, (compilation) => {
64
65
  compilation.hooks.processAssets.tapPromise(
65
66
  {
@@ -131,6 +132,26 @@ function setupWebpackV5ProcessAssetsHook(options) {
131
132
  }
132
133
  };
133
134
  const groupedEntries = getGroupedEntries(entries, compilerOptions);
135
+ const getCssHandlerOptions = (file) => {
136
+ const majorVersion = runtimeState.twPatcher.majorVersion;
137
+ const isMainChunk = compilerOptions.mainCssChunkMatcher(file, appType);
138
+ const cacheKey = `${majorVersion ?? "unknown"}:${isMainChunk ? "1" : "0"}:${file}`;
139
+ const cached = cssHandlerOptionsCache.get(cacheKey);
140
+ if (cached) {
141
+ return cached;
142
+ }
143
+ const created = {
144
+ isMainChunk,
145
+ postcssOptions: {
146
+ options: {
147
+ from: file
148
+ }
149
+ },
150
+ majorVersion
151
+ };
152
+ cssHandlerOptionsCache.set(cacheKey, created);
153
+ return created;
154
+ };
134
155
  const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
135
156
  const runtimeSet = await ensureRuntimeClassSet(runtimeState, {
136
157
  // webpack 的 script-only 热更新可能不会触发 runtime classset loader,
@@ -138,6 +159,9 @@ function setupWebpackV5ProcessAssetsHook(options) {
138
159
  forceCollect: true,
139
160
  allowEmpty: false
140
161
  });
162
+ const defaultTemplateHandlerOptions = {
163
+ runtimeSet
164
+ };
141
165
  debug2("get runtimeSet, class count: %d", runtimeSet.size);
142
166
  const tasks = [];
143
167
  if (Array.isArray(groupedEntries.html)) {
@@ -160,9 +184,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
160
184
  debug2("html cache hit: %s", file);
161
185
  },
162
186
  transform: async () => {
163
- const wxml = await compilerOptions.templateHandler(rawSource, {
164
- runtimeSet
165
- });
187
+ const wxml = await compilerOptions.templateHandler(rawSource, defaultTemplateHandlerOptions);
166
188
  const source = new ConcatSource(wxml);
167
189
  compilerOptions.onUpdate(file, rawSource, wxml);
168
190
  debug2("html handle: %s", file);
@@ -245,15 +267,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
245
267
  },
246
268
  transform: async () => {
247
269
  await runtimeState.patchPromise;
248
- const { css } = await compilerOptions.styleHandler(rawSource, {
249
- isMainChunk: compilerOptions.mainCssChunkMatcher(file, appType),
250
- postcssOptions: {
251
- options: {
252
- from: file
253
- }
254
- },
255
- majorVersion: runtimeState.twPatcher.majorVersion
256
- });
270
+ const { css } = await compilerOptions.styleHandler(rawSource, getCssHandlerOptions(file));
257
271
  const source = new ConcatSource(css);
258
272
  compilerOptions.onUpdate(file, rawSource, css);
259
273
  debug2("css handle: %s", file);