weapp-tailwindcss 4.12.0-next.0 → 5.0.0-next.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 (310) hide show
  1. package/bin/weapp-tailwindcss.js +21 -1
  2. package/dist/babel/index.d.ts +3 -0
  3. package/dist/bundlers/gulp/index.d.ts +7 -0
  4. package/dist/bundlers/shared/cache.d.ts +16 -0
  5. package/dist/bundlers/shared/css-cleanup.d.ts +4 -0
  6. package/dist/bundlers/shared/css-imports.d.ts +8 -0
  7. package/dist/bundlers/shared/generator-candidates.d.ts +5 -0
  8. package/dist/bundlers/shared/generator-css.d.ts +41 -0
  9. package/dist/bundlers/shared/module-graph.d.ts +5 -0
  10. package/dist/bundlers/shared/run-tasks.d.ts +2 -0
  11. package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
  12. package/dist/bundlers/vite/bundle-state.d.ts +43 -0
  13. package/dist/bundlers/vite/css-finalizer.d.ts +19 -0
  14. package/dist/bundlers/vite/generate-bundle.d.ts +20 -0
  15. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
  16. package/dist/bundlers/vite/index.d.ts +3 -0
  17. package/dist/bundlers/vite/js-precheck.d.ts +1 -0
  18. package/dist/bundlers/vite/query.d.ts +15 -0
  19. package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
  20. package/dist/bundlers/vite/rewrite-css-imports.d.ts +11 -0
  21. package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
  22. package/dist/bundlers/vite/utils.d.ts +9 -0
  23. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +20 -0
  24. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +14 -0
  25. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +15 -0
  26. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +9 -0
  27. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +17 -0
  28. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +19 -0
  29. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
  30. package/dist/bundlers/webpack/index.d.ts +1 -0
  31. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +12 -0
  32. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
  33. package/dist/bundlers/webpack/shared/css-imports.d.ts +6 -0
  34. package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
  35. package/dist/cache/index.d.ts +38 -0
  36. package/dist/cache/md5.d.ts +1 -0
  37. package/dist/chunk-8l464Juk.js +28 -0
  38. package/dist/cli/config.d.ts +5 -0
  39. package/dist/cli/context.d.ts +16 -0
  40. package/dist/cli/doctor/constants.d.ts +7 -0
  41. package/dist/cli/doctor/types.d.ts +31 -0
  42. package/dist/cli/doctor.d.ts +4 -0
  43. package/dist/cli/helpers/options/format.d.ts +2 -0
  44. package/dist/cli/helpers/options/parse.d.ts +3 -0
  45. package/dist/cli/helpers/options/resolve.d.ts +1 -0
  46. package/dist/cli/helpers/options.d.ts +3 -0
  47. package/dist/cli/helpers/patch-cwd.d.ts +1 -0
  48. package/dist/cli/helpers.d.ts +5 -0
  49. package/dist/cli/mount-options/patch-status.d.ts +2 -0
  50. package/dist/cli/mount-options.d.ts +2 -0
  51. package/dist/cli/patch-options.d.ts +6 -0
  52. package/dist/cli/tokens.d.ts +4 -0
  53. package/dist/cli/types.d.ts +17 -0
  54. package/dist/cli/vscode-entry.d.ts +14 -0
  55. package/dist/cli/workspace/package-dirs.d.ts +3 -0
  56. package/dist/cli/workspace/patch-package.d.ts +3 -0
  57. package/dist/cli/workspace/patch-utils.d.ts +3 -0
  58. package/dist/cli/workspace/types.d.ts +11 -0
  59. package/dist/cli/workspace/workspace-globs.d.ts +2 -0
  60. package/dist/cli/workspace/workspace-io.d.ts +1 -0
  61. package/dist/cli/workspace/workspace-lock.d.ts +1 -0
  62. package/dist/cli/workspace.d.ts +2 -0
  63. package/dist/cli.d.ts +1 -2
  64. package/dist/cli.js +2517 -1544
  65. package/dist/cli.mjs +2493 -1524
  66. package/dist/constants-B-_T5UnW.mjs +44 -0
  67. package/dist/constants-p1dyh1x1.js +73 -0
  68. package/dist/constants.d.ts +13 -0
  69. package/dist/context/compiler-context-cache.d.ts +3 -0
  70. package/dist/context/custom-attributes.d.ts +2 -0
  71. package/dist/context/handlers.d.ts +6 -0
  72. package/dist/context/index.d.ts +7 -0
  73. package/dist/context/logger.d.ts +4 -0
  74. package/dist/context/tailwindcss/basedir.d.ts +1 -0
  75. package/dist/context/tailwindcss/rax.d.ts +2 -0
  76. package/dist/context/tailwindcss.d.ts +4 -0
  77. package/dist/context/workspace.d.ts +3 -0
  78. package/dist/core.d.ts +5 -21
  79. package/dist/core.js +138 -180
  80. package/dist/core.mjs +135 -180
  81. package/dist/css-imports-BbrbluP9.js +177 -0
  82. package/dist/css-imports-CSdPq_Sc.mjs +128 -0
  83. package/dist/css-macro/constants.d.ts +14 -0
  84. package/dist/css-macro/index.d.ts +15 -0
  85. package/dist/css-macro/postcss.d.ts +3 -7
  86. package/dist/css-macro/postcss.js +44 -58
  87. package/dist/css-macro/postcss.mjs +44 -56
  88. package/dist/css-macro.d.ts +1 -20
  89. package/dist/css-macro.js +37 -50
  90. package/dist/css-macro.mjs +33 -47
  91. package/dist/debug/index.d.ts +5 -0
  92. package/dist/defaults.d.ts +2 -11
  93. package/dist/defaults.js +132 -8
  94. package/dist/defaults.mjs +128 -7
  95. package/dist/escape.js +31 -54
  96. package/dist/escape.mjs +18 -25
  97. package/dist/experimental/index.d.ts +2 -0
  98. package/dist/experimental/oxc/ast-utils.d.ts +30 -0
  99. package/dist/experimental/oxc/index.d.ts +2 -0
  100. package/dist/experimental/oxc/module-specifiers.d.ts +2 -0
  101. package/dist/experimental/shared/cache.d.ts +3 -0
  102. package/dist/experimental/shared/transform.d.ts +3 -0
  103. package/dist/experimental/shared.d.ts +8 -0
  104. package/dist/experimental/swc/ast-utils.d.ts +30 -0
  105. package/dist/experimental/swc/index.d.ts +2 -0
  106. package/dist/experimental/swc/module-specifiers.d.ts +2 -0
  107. package/dist/generator/index.d.ts +11 -0
  108. package/dist/generator/options.d.ts +15 -0
  109. package/dist/generator/types.d.ts +19 -0
  110. package/dist/generator-CZ-JXw6T.js +492 -0
  111. package/dist/generator-Dwxgra97.mjs +399 -0
  112. package/dist/generator-css-CnYjiMrD.js +1084 -0
  113. package/dist/generator-css-DhPFjSzK.mjs +1057 -0
  114. package/dist/generator.d.ts +1 -0
  115. package/dist/generator.js +19 -0
  116. package/dist/generator.mjs +2 -0
  117. package/dist/gulp.d.ts +4 -24
  118. package/dist/gulp.js +271 -13
  119. package/dist/gulp.mjs +263 -13
  120. package/dist/index.d.ts +8 -15
  121. package/dist/index.js +12 -24
  122. package/dist/index.mjs +6 -24
  123. package/dist/js/JsTokenUpdater.d.ts +14 -0
  124. package/dist/js/ModuleGraph.d.ts +18 -0
  125. package/dist/js/NodePathWalker.d.ts +33 -0
  126. package/dist/js/babel/parse.d.ts +9 -0
  127. package/dist/js/babel/process.d.ts +4 -0
  128. package/dist/js/babel.d.ts +13 -0
  129. package/dist/js/class-context.d.ts +3 -0
  130. package/dist/js/evalTransforms.d.ts +7 -0
  131. package/dist/js/handlers.d.ts +5 -0
  132. package/dist/js/index.d.ts +4 -0
  133. package/dist/js/module-graph/ignored-exports.d.ts +18 -0
  134. package/dist/js/module-graph/types.d.ts +17 -0
  135. package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
  136. package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
  137. package/dist/js/precheck.d.ts +2 -0
  138. package/dist/js/sourceAnalysis.d.ts +17 -0
  139. package/dist/js/syntax.d.ts +10 -0
  140. package/dist/js/taggedTemplateIgnore.d.ts +13 -0
  141. package/dist/js/types.d.ts +11 -0
  142. package/dist/lightningcss/index.d.ts +8 -0
  143. package/dist/lightningcss/style-handler/options.d.ts +3 -0
  144. package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
  145. package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
  146. package/dist/lightningcss/style-handler.d.ts +17 -0
  147. package/dist/loader-anchors-DvwgIYdA.mjs +205 -0
  148. package/dist/loader-anchors-cprm4Klq.js +273 -0
  149. package/dist/logger/index.d.ts +2 -0
  150. package/dist/logger-BZ45DZJT.js +1003 -0
  151. package/dist/logger-BoVx1Dbt.mjs +935 -0
  152. package/dist/patcher-options-6gJN2EXy.js +115 -0
  153. package/dist/patcher-options-DQfR5xxT.mjs +92 -0
  154. package/dist/postcss-html-transform.d.ts +3 -3
  155. package/dist/postcss-html-transform.js +7 -10
  156. package/dist/postcss-html-transform.mjs +3 -6
  157. package/dist/postcss.d.ts +15 -0
  158. package/dist/postcss.js +278 -0
  159. package/dist/postcss.mjs +268 -0
  160. package/dist/presets/hbuilderx.d.ts +4 -0
  161. package/dist/presets/index.d.ts +3 -0
  162. package/dist/presets/shared.d.ts +10 -0
  163. package/dist/presets/taro.d.ts +4 -0
  164. package/dist/presets/uni-app-x.d.ts +16 -0
  165. package/dist/presets/uni-app.d.ts +4 -0
  166. package/dist/presets.d.ts +1 -76
  167. package/dist/presets.js +115 -163
  168. package/dist/presets.mjs +107 -163
  169. package/dist/recorder-B_XyZ576.mjs +2763 -0
  170. package/dist/recorder-rn_2v_nd.js +2878 -0
  171. package/dist/reset/index.d.ts +2 -0
  172. package/dist/reset.d.ts +1 -4
  173. package/dist/reset.js +19 -8
  174. package/dist/reset.mjs +2 -8
  175. package/dist/shared/classname-transform.d.ts +14 -0
  176. package/dist/shared/mpx.d.ts +7 -0
  177. package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
  178. package/dist/tailwindcss/index.d.ts +11 -0
  179. package/dist/tailwindcss/miniprogram.d.ts +1 -0
  180. package/dist/tailwindcss/patcher-options.d.ts +56 -0
  181. package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
  182. package/dist/tailwindcss/patcher.d.ts +13 -0
  183. package/dist/tailwindcss/recorder.d.ts +13 -0
  184. package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
  185. package/dist/tailwindcss/runtime/cache.d.ts +11 -0
  186. package/dist/tailwindcss/runtime-logs.d.ts +3 -0
  187. package/dist/tailwindcss/runtime.d.ts +29 -0
  188. package/dist/tailwindcss/targets/paths.d.ts +13 -0
  189. package/dist/tailwindcss/targets/record-io.d.ts +5 -0
  190. package/dist/tailwindcss/targets/recorder.d.ts +3 -0
  191. package/dist/tailwindcss/targets/types.d.ts +35 -0
  192. package/dist/tailwindcss/targets.d.ts +6 -0
  193. package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
  194. package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
  195. package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
  196. package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
  197. package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
  198. package/dist/tailwindcss/v4/config.d.ts +5 -0
  199. package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
  200. package/dist/tailwindcss/v4/index.d.ts +2 -0
  201. package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
  202. package/dist/tailwindcss/v4/patcher-options.d.ts +24 -0
  203. package/dist/tailwindcss/v4/patcher.d.ts +14 -0
  204. package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
  205. package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
  206. package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
  207. package/dist/tailwindcss/v4-engine/miniprogram.d.ts +4 -0
  208. package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
  209. package/dist/tailwindcss/v4-engine/types.d.ts +17 -0
  210. package/dist/typedoc.export.d.ts +5 -0
  211. package/dist/types/base.d.ts +1 -0
  212. package/dist/types/disabled-options.d.ts +4 -0
  213. package/dist/types/index.d.ts +104 -0
  214. package/dist/types/shared.d.ts +7 -0
  215. package/dist/types/user-defined-options/general.d.ts +31 -0
  216. package/dist/types/user-defined-options/important.d.ts +37 -0
  217. package/dist/types/user-defined-options/index.d.ts +11 -0
  218. package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
  219. package/dist/types/user-defined-options/matcher.d.ts +9 -0
  220. package/dist/types.d.ts +1 -150
  221. package/dist/types.js +0 -1
  222. package/dist/types.mjs +1 -1
  223. package/dist/uni-app-x/component-local-style.d.ts +19 -0
  224. package/dist/uni-app-x/index.d.ts +2 -0
  225. package/dist/uni-app-x/options.d.ts +12 -0
  226. package/dist/uni-app-x/style-isolation.d.ts +2 -0
  227. package/dist/uni-app-x/transform.d.ts +9 -0
  228. package/dist/uni-app-x/vite.d.ts +36 -0
  229. package/dist/utils/decode.d.ts +2 -0
  230. package/dist/utils/disabled.d.ts +6 -0
  231. package/dist/utils/hbuilderx.d.ts +5 -0
  232. package/dist/utils/index.d.ts +7 -0
  233. package/dist/utils/nameMatcher.d.ts +4 -0
  234. package/dist/utils/resolve-package.d.ts +1 -0
  235. package/dist/utils/uni-platform.d.ts +11 -0
  236. package/dist/utils-7DUGTFED.mjs +48 -0
  237. package/dist/utils-DmC9_In3.js +61 -0
  238. package/dist/vite-BHpAqldo.js +1952 -0
  239. package/dist/vite-C8JlHiyR.mjs +1940 -0
  240. package/dist/vite.d.ts +4 -17
  241. package/dist/vite.js +5 -14
  242. package/dist/vite.mjs +2 -14
  243. package/dist/weapp-tw-css-import-rewrite-loader.js +59 -87
  244. package/dist/weapp-tw-runtime-classset-loader.js +33 -47
  245. package/dist/webpack-CABjKGGQ.mjs +441 -0
  246. package/dist/webpack-DNIJ0ysE.js +456 -0
  247. package/dist/webpack.d.ts +4 -25
  248. package/dist/webpack.js +6 -17
  249. package/dist/webpack.mjs +2 -17
  250. package/dist/webpack4.d.ts +4 -26
  251. package/dist/webpack4.js +379 -481
  252. package/dist/webpack4.mjs +370 -482
  253. package/dist/wxml/Tokenizer.d.ts +15 -0
  254. package/dist/wxml/custom-attributes.d.ts +4 -0
  255. package/dist/wxml/index.d.ts +2 -0
  256. package/dist/wxml/shared.d.ts +2 -0
  257. package/dist/wxml/tokenizer/types.d.ts +18 -0
  258. package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
  259. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
  260. package/dist/wxml/utils/codegen.d.ts +2 -0
  261. package/dist/wxml/utils/custom-template.d.ts +3 -0
  262. package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
  263. package/dist/wxml/utils/fragment-updater.d.ts +4 -0
  264. package/dist/wxml/utils/template-fragments.d.ts +3 -0
  265. package/dist/wxml/utils.d.ts +8 -0
  266. package/dist/wxml/whitespace.d.ts +2 -0
  267. package/generator-placeholder.css +1 -0
  268. package/package.json +28 -13
  269. package/scripts/postinstall.mjs +59 -0
  270. package/dist/chunk-2LH6PZH3.mjs +0 -51
  271. package/dist/chunk-4AFQP74Z.js +0 -24
  272. package/dist/chunk-5ONE75V7.js +0 -2381
  273. package/dist/chunk-76S2EME4.mjs +0 -34
  274. package/dist/chunk-A5PB4KZT.js +0 -138
  275. package/dist/chunk-AYJ4HLWZ.mjs +0 -1508
  276. package/dist/chunk-DYLQ6UOI.js +0 -71
  277. package/dist/chunk-F2CKKG6Q.mjs +0 -171
  278. package/dist/chunk-F5XJWJYO.mjs +0 -582
  279. package/dist/chunk-FMK6SFQQ.js +0 -276
  280. package/dist/chunk-GC7WXUOW.js +0 -3906
  281. package/dist/chunk-GD4SQMVF.mjs +0 -2378
  282. package/dist/chunk-GMKSBLNY.js +0 -175
  283. package/dist/chunk-HL3US2OT.mjs +0 -10
  284. package/dist/chunk-LVSUBDJC.js +0 -579
  285. package/dist/chunk-NIS74SI6.js +0 -1511
  286. package/dist/chunk-OF6MFURR.js +0 -34
  287. package/dist/chunk-ONLKZIRQ.js +0 -7
  288. package/dist/chunk-OOHJLO5M.mjs +0 -71
  289. package/dist/chunk-OYSABARD.js +0 -51
  290. package/dist/chunk-QNRJCEZN.mjs +0 -3906
  291. package/dist/chunk-UUJWDME4.mjs +0 -276
  292. package/dist/chunk-WSS26HZS.js +0 -292
  293. package/dist/chunk-XAKAD2CR.mjs +0 -138
  294. package/dist/chunk-ZR3KN3FG.mjs +0 -292
  295. package/dist/cli.d.mts +0 -2
  296. package/dist/core.d.mts +0 -26
  297. package/dist/css-macro/postcss.d.mts +0 -7
  298. package/dist/css-macro.d.mts +0 -18
  299. package/dist/defaults.d.mts +0 -11
  300. package/dist/gulp.d.mts +0 -24
  301. package/dist/index-BXrmQelt.d.mts +0 -672
  302. package/dist/index-BXrmQelt.d.ts +0 -672
  303. package/dist/index.d.mts +0 -15
  304. package/dist/postcss-html-transform.d.mts +0 -2
  305. package/dist/presets.d.mts +0 -76
  306. package/dist/reset.d.mts +0 -1
  307. package/dist/types.d.mts +0 -150
  308. package/dist/vite.d.mts +0 -17
  309. package/dist/webpack.d.mts +0 -25
  310. package/dist/webpack4.d.mts +0 -26
@@ -1,34 +0,0 @@
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; }// src/bundlers/shared/cache.ts
2
- async function processCachedTask({
3
- cache,
4
- cacheKey,
5
- hashKey = cacheKey,
6
- rawSource,
7
- hash,
8
- readCache,
9
- applyResult,
10
- transform,
11
- onCacheHit
12
- }) {
13
- let cacheHit = false;
14
- const result = await cache.process({
15
- key: cacheKey,
16
- hashKey,
17
- rawSource,
18
- hash,
19
- resolveCache: readCache,
20
- async onCacheHit(value) {
21
- cacheHit = true;
22
- await applyResult(value);
23
- _optionalChain([onCacheHit, 'optionalCall', _ => _()]);
24
- },
25
- transform
26
- });
27
- if (!cacheHit) {
28
- await applyResult(result);
29
- }
30
- }
31
-
32
-
33
-
34
- exports.processCachedTask = processCachedTask;
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@24.12.2__@swc+core@1.15.32_@swc+_5ed6cbcda668e45f9f2d3d9f21b34c59/node_modules/tsup/assets/cjs_shims.js
2
- var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
3
- var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
4
-
5
-
6
-
7
- exports.importMetaUrl = importMetaUrl;
@@ -1,71 +0,0 @@
1
- // src/utils/index.ts
2
- import { defu, defuOverrideArray, groupBy, isMap, isRegexp, noop, regExpTest, removeExt } from "@weapp-tailwindcss/shared";
3
-
4
- // src/utils/hbuilderx.ts
5
- import path from "path";
6
- import process from "process";
7
-
8
- // src/utils/uni-platform.ts
9
- import process2 from "process";
10
- function normalizePlatform(value) {
11
- return value?.trim().toLowerCase() || void 0;
12
- }
13
- function resolveUniUtsPlatform(value = process2.env.UNI_UTS_PLATFORM) {
14
- const normalized = normalizePlatform(value);
15
- const isAppAndroid = normalized === "app-android";
16
- const isAppIos = normalized === "app-ios";
17
- const isAppHarmony = normalized === "app-harmony";
18
- const isApp = normalized?.startsWith("app-") === true || normalized === "app" || normalized === "app-plus";
19
- const isMp = normalized?.startsWith("mp-") === true;
20
- const isWeb = normalized?.startsWith("web") === true || normalized === "h5";
21
- return {
22
- raw: value,
23
- normalized,
24
- isApp,
25
- isAppAndroid,
26
- isAppHarmony,
27
- isAppIos,
28
- isMp,
29
- isWeb
30
- };
31
- }
32
-
33
- // src/utils/index.ts
34
- function classifyEntry(filename, options) {
35
- if (options.cssMatcher(filename)) {
36
- return "css";
37
- }
38
- if (options.htmlMatcher(filename)) {
39
- return "html";
40
- }
41
- if (options.jsMatcher(filename) || options.wxsMatcher(filename)) {
42
- return "js";
43
- }
44
- return "other";
45
- }
46
- function createEmptyGroups() {
47
- return {
48
- css: [],
49
- html: [],
50
- js: [],
51
- other: []
52
- };
53
- }
54
- function getGroupedEntries(entries, options) {
55
- const groups = createEmptyGroups();
56
- for (const entry of entries) {
57
- const [filename] = entry;
58
- const group = classifyEntry(filename, options);
59
- groups[group].push(entry);
60
- }
61
- return groups;
62
- }
63
-
64
- export {
65
- resolveUniUtsPlatform,
66
- defu,
67
- defuOverrideArray,
68
- isMap,
69
- noop,
70
- getGroupedEntries
71
- };
@@ -1,51 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/css-macro/constants.ts
2
- var queryKey = "weapp-tw-platform";
3
- function createMediaQuery(value) {
4
- return `@media (${queryKey}:"${value}"){&}`;
5
- }
6
- function createNegativeMediaQuery(value) {
7
- return `@media not screen and (${queryKey}:"${value}"){&}`;
8
- }
9
- var UNESCAPED_UNDERSCORE_RE = /(?<!\\)_/g;
10
- var WHITESPACE_RE = /\s+/g;
11
- var LOGICAL_OPERATOR_RE = /\s*(\|\||&&)\s*/g;
12
- function normalComment(text) {
13
- if (typeof text === "string") {
14
- const normalized = text.replaceAll(UNESCAPED_UNDERSCORE_RE, " ").replaceAll(WHITESPACE_RE, " ").trim();
15
- if (normalized.includes("\\")) {
16
- return normalized;
17
- }
18
- return normalized.replaceAll(LOGICAL_OPERATOR_RE, " $1 ").replaceAll(WHITESPACE_RE, " ").trim();
19
- }
20
- return text;
21
- }
22
- function ifdef(text) {
23
- return {
24
- start: `#ifdef ${normalComment(text)}`,
25
- end: `#endif`
26
- };
27
- }
28
- function ifndef(text) {
29
- return {
30
- start: `#ifndef ${normalComment(text)}`,
31
- end: `#endif`
32
- };
33
- }
34
- var QUERY_KEY_REGEX = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, "g");
35
- function matchCustomPropertyFromValue(str, cb) {
36
- let arr;
37
- let index = 0;
38
- QUERY_KEY_REGEX.lastIndex = 0;
39
- while ((arr = QUERY_KEY_REGEX.exec(str)) !== null) {
40
- cb(arr, index);
41
- index++;
42
- }
43
- }
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
- exports.createMediaQuery = createMediaQuery; exports.createNegativeMediaQuery = createNegativeMediaQuery; exports.ifdef = ifdef; exports.ifndef = ifndef; exports.matchCustomPropertyFromValue = matchCustomPropertyFromValue;