weapp-tailwindcss 4.12.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 (308) hide show
  1. package/dist/babel/index.d.ts +3 -0
  2. package/dist/bundlers/gulp/index.d.ts +7 -0
  3. package/dist/bundlers/shared/cache.d.ts +16 -0
  4. package/dist/bundlers/shared/css-cleanup.d.ts +4 -0
  5. package/dist/bundlers/shared/css-imports.d.ts +8 -0
  6. package/dist/bundlers/shared/generator-candidates.d.ts +5 -0
  7. package/dist/bundlers/shared/generator-css.d.ts +41 -0
  8. package/dist/bundlers/shared/module-graph.d.ts +5 -0
  9. package/dist/bundlers/shared/run-tasks.d.ts +2 -0
  10. package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
  11. package/dist/bundlers/vite/bundle-state.d.ts +43 -0
  12. package/dist/bundlers/vite/css-finalizer.d.ts +19 -0
  13. package/dist/bundlers/vite/generate-bundle.d.ts +20 -0
  14. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
  15. package/dist/bundlers/vite/index.d.ts +3 -0
  16. package/dist/bundlers/vite/js-precheck.d.ts +1 -0
  17. package/dist/bundlers/vite/query.d.ts +15 -0
  18. package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
  19. package/dist/bundlers/vite/rewrite-css-imports.d.ts +11 -0
  20. package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
  21. package/dist/bundlers/vite/utils.d.ts +9 -0
  22. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +20 -0
  23. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +14 -0
  24. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +15 -0
  25. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +9 -0
  26. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +17 -0
  27. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +19 -0
  28. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
  29. package/dist/bundlers/webpack/index.d.ts +1 -0
  30. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +12 -0
  31. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
  32. package/dist/bundlers/webpack/shared/css-imports.d.ts +6 -0
  33. package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
  34. package/dist/cache/index.d.ts +38 -0
  35. package/dist/cache/md5.d.ts +1 -0
  36. package/dist/chunk-8l464Juk.js +28 -0
  37. package/dist/cli/config.d.ts +5 -0
  38. package/dist/cli/context.d.ts +16 -0
  39. package/dist/cli/doctor/constants.d.ts +7 -0
  40. package/dist/cli/doctor/types.d.ts +31 -0
  41. package/dist/cli/doctor.d.ts +4 -0
  42. package/dist/cli/helpers/options/format.d.ts +2 -0
  43. package/dist/cli/helpers/options/parse.d.ts +3 -0
  44. package/dist/cli/helpers/options/resolve.d.ts +1 -0
  45. package/dist/cli/helpers/options.d.ts +3 -0
  46. package/dist/cli/helpers/patch-cwd.d.ts +1 -0
  47. package/dist/cli/helpers.d.ts +5 -0
  48. package/dist/cli/mount-options/patch-status.d.ts +2 -0
  49. package/dist/cli/mount-options.d.ts +2 -0
  50. package/dist/cli/patch-options.d.ts +6 -0
  51. package/dist/cli/tokens.d.ts +4 -0
  52. package/dist/cli/types.d.ts +17 -0
  53. package/dist/cli/vscode-entry.d.ts +14 -0
  54. package/dist/cli/workspace/package-dirs.d.ts +3 -0
  55. package/dist/cli/workspace/patch-package.d.ts +3 -0
  56. package/dist/cli/workspace/patch-utils.d.ts +3 -0
  57. package/dist/cli/workspace/types.d.ts +11 -0
  58. package/dist/cli/workspace/workspace-globs.d.ts +2 -0
  59. package/dist/cli/workspace/workspace-io.d.ts +1 -0
  60. package/dist/cli/workspace/workspace-lock.d.ts +1 -0
  61. package/dist/cli/workspace.d.ts +2 -0
  62. package/dist/cli.d.ts +1 -2
  63. package/dist/cli.js +2425 -3524
  64. package/dist/cli.mjs +2402 -3505
  65. package/dist/constants-B-_T5UnW.mjs +44 -0
  66. package/dist/constants-p1dyh1x1.js +73 -0
  67. package/dist/constants.d.ts +13 -0
  68. package/dist/context/compiler-context-cache.d.ts +3 -0
  69. package/dist/context/custom-attributes.d.ts +2 -0
  70. package/dist/context/handlers.d.ts +6 -0
  71. package/dist/context/index.d.ts +7 -0
  72. package/dist/context/logger.d.ts +4 -0
  73. package/dist/context/tailwindcss/basedir.d.ts +1 -0
  74. package/dist/context/tailwindcss/rax.d.ts +2 -0
  75. package/dist/context/tailwindcss.d.ts +4 -0
  76. package/dist/context/workspace.d.ts +3 -0
  77. package/dist/core.d.ts +5 -21
  78. package/dist/core.js +138 -180
  79. package/dist/core.mjs +135 -180
  80. package/dist/css-imports-BbrbluP9.js +177 -0
  81. package/dist/css-imports-CSdPq_Sc.mjs +128 -0
  82. package/dist/css-macro/constants.d.ts +14 -0
  83. package/dist/css-macro/index.d.ts +15 -0
  84. package/dist/css-macro/postcss.d.ts +3 -7
  85. package/dist/css-macro/postcss.js +44 -58
  86. package/dist/css-macro/postcss.mjs +44 -56
  87. package/dist/css-macro.d.ts +1 -20
  88. package/dist/css-macro.js +37 -50
  89. package/dist/css-macro.mjs +33 -47
  90. package/dist/debug/index.d.ts +5 -0
  91. package/dist/defaults.d.ts +2 -11
  92. package/dist/defaults.js +132 -8
  93. package/dist/defaults.mjs +128 -7
  94. package/dist/escape.js +31 -54
  95. package/dist/escape.mjs +18 -25
  96. package/dist/experimental/index.d.ts +2 -0
  97. package/dist/experimental/oxc/ast-utils.d.ts +30 -0
  98. package/dist/experimental/oxc/index.d.ts +2 -0
  99. package/dist/experimental/oxc/module-specifiers.d.ts +2 -0
  100. package/dist/experimental/shared/cache.d.ts +3 -0
  101. package/dist/experimental/shared/transform.d.ts +3 -0
  102. package/dist/experimental/shared.d.ts +8 -0
  103. package/dist/experimental/swc/ast-utils.d.ts +30 -0
  104. package/dist/experimental/swc/index.d.ts +2 -0
  105. package/dist/experimental/swc/module-specifiers.d.ts +2 -0
  106. package/dist/generator/index.d.ts +11 -0
  107. package/dist/generator/options.d.ts +15 -0
  108. package/dist/generator/types.d.ts +19 -0
  109. package/dist/generator-CZ-JXw6T.js +492 -0
  110. package/dist/generator-Dwxgra97.mjs +399 -0
  111. package/dist/generator-css-CnYjiMrD.js +1084 -0
  112. package/dist/generator-css-DhPFjSzK.mjs +1057 -0
  113. package/dist/generator.d.ts +1 -0
  114. package/dist/generator.js +19 -0
  115. package/dist/generator.mjs +2 -0
  116. package/dist/gulp.d.ts +4 -24
  117. package/dist/gulp.js +271 -13
  118. package/dist/gulp.mjs +263 -13
  119. package/dist/index.d.ts +8 -15
  120. package/dist/index.js +12 -24
  121. package/dist/index.mjs +6 -24
  122. package/dist/js/JsTokenUpdater.d.ts +14 -0
  123. package/dist/js/ModuleGraph.d.ts +18 -0
  124. package/dist/js/NodePathWalker.d.ts +33 -0
  125. package/dist/js/babel/parse.d.ts +9 -0
  126. package/dist/js/babel/process.d.ts +4 -0
  127. package/dist/js/babel.d.ts +13 -0
  128. package/dist/js/class-context.d.ts +3 -0
  129. package/dist/js/evalTransforms.d.ts +7 -0
  130. package/dist/js/handlers.d.ts +5 -0
  131. package/dist/js/index.d.ts +4 -0
  132. package/dist/js/module-graph/ignored-exports.d.ts +18 -0
  133. package/dist/js/module-graph/types.d.ts +17 -0
  134. package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
  135. package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
  136. package/dist/js/precheck.d.ts +2 -0
  137. package/dist/js/sourceAnalysis.d.ts +17 -0
  138. package/dist/js/syntax.d.ts +10 -0
  139. package/dist/js/taggedTemplateIgnore.d.ts +13 -0
  140. package/dist/js/types.d.ts +11 -0
  141. package/dist/lightningcss/index.d.ts +8 -0
  142. package/dist/lightningcss/style-handler/options.d.ts +3 -0
  143. package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
  144. package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
  145. package/dist/lightningcss/style-handler.d.ts +17 -0
  146. package/dist/loader-anchors-DvwgIYdA.mjs +205 -0
  147. package/dist/loader-anchors-cprm4Klq.js +273 -0
  148. package/dist/logger/index.d.ts +2 -0
  149. package/dist/logger-BZ45DZJT.js +1003 -0
  150. package/dist/logger-BoVx1Dbt.mjs +935 -0
  151. package/dist/patcher-options-6gJN2EXy.js +115 -0
  152. package/dist/patcher-options-DQfR5xxT.mjs +92 -0
  153. package/dist/postcss-html-transform.d.ts +3 -3
  154. package/dist/postcss-html-transform.js +7 -10
  155. package/dist/postcss-html-transform.mjs +3 -6
  156. package/dist/postcss.d.ts +15 -0
  157. package/dist/postcss.js +278 -0
  158. package/dist/postcss.mjs +268 -0
  159. package/dist/presets/hbuilderx.d.ts +4 -0
  160. package/dist/presets/index.d.ts +3 -0
  161. package/dist/presets/shared.d.ts +10 -0
  162. package/dist/presets/taro.d.ts +4 -0
  163. package/dist/presets/uni-app-x.d.ts +16 -0
  164. package/dist/presets/uni-app.d.ts +4 -0
  165. package/dist/presets.d.ts +1 -76
  166. package/dist/presets.js +115 -163
  167. package/dist/presets.mjs +107 -163
  168. package/dist/recorder-B_XyZ576.mjs +2763 -0
  169. package/dist/recorder-rn_2v_nd.js +2878 -0
  170. package/dist/reset/index.d.ts +2 -0
  171. package/dist/reset.d.ts +1 -4
  172. package/dist/reset.js +19 -8
  173. package/dist/reset.mjs +2 -8
  174. package/dist/shared/classname-transform.d.ts +14 -0
  175. package/dist/shared/mpx.d.ts +7 -0
  176. package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
  177. package/dist/tailwindcss/index.d.ts +11 -0
  178. package/dist/tailwindcss/miniprogram.d.ts +1 -0
  179. package/dist/tailwindcss/patcher-options.d.ts +56 -0
  180. package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
  181. package/dist/tailwindcss/patcher.d.ts +13 -0
  182. package/dist/tailwindcss/recorder.d.ts +13 -0
  183. package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
  184. package/dist/tailwindcss/runtime/cache.d.ts +11 -0
  185. package/dist/tailwindcss/runtime-logs.d.ts +3 -0
  186. package/dist/tailwindcss/runtime.d.ts +29 -0
  187. package/dist/tailwindcss/targets/paths.d.ts +13 -0
  188. package/dist/tailwindcss/targets/record-io.d.ts +5 -0
  189. package/dist/tailwindcss/targets/recorder.d.ts +3 -0
  190. package/dist/tailwindcss/targets/types.d.ts +35 -0
  191. package/dist/tailwindcss/targets.d.ts +6 -0
  192. package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
  193. package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
  194. package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
  195. package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
  196. package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
  197. package/dist/tailwindcss/v4/config.d.ts +5 -0
  198. package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
  199. package/dist/tailwindcss/v4/index.d.ts +2 -0
  200. package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
  201. package/dist/tailwindcss/v4/patcher-options.d.ts +24 -0
  202. package/dist/tailwindcss/v4/patcher.d.ts +14 -0
  203. package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
  204. package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
  205. package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
  206. package/dist/tailwindcss/v4-engine/miniprogram.d.ts +4 -0
  207. package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
  208. package/dist/tailwindcss/v4-engine/types.d.ts +17 -0
  209. package/dist/typedoc.export.d.ts +5 -0
  210. package/dist/types/base.d.ts +1 -0
  211. package/dist/types/disabled-options.d.ts +4 -0
  212. package/dist/types/index.d.ts +104 -0
  213. package/dist/types/shared.d.ts +7 -0
  214. package/dist/types/user-defined-options/general.d.ts +31 -0
  215. package/dist/types/user-defined-options/important.d.ts +37 -0
  216. package/dist/types/user-defined-options/index.d.ts +11 -0
  217. package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
  218. package/dist/types/user-defined-options/matcher.d.ts +9 -0
  219. package/dist/types.d.ts +1 -150
  220. package/dist/types.js +0 -1
  221. package/dist/types.mjs +1 -1
  222. package/dist/uni-app-x/component-local-style.d.ts +19 -0
  223. package/dist/uni-app-x/index.d.ts +2 -0
  224. package/dist/uni-app-x/options.d.ts +12 -0
  225. package/dist/uni-app-x/style-isolation.d.ts +2 -0
  226. package/dist/uni-app-x/transform.d.ts +9 -0
  227. package/dist/uni-app-x/vite.d.ts +36 -0
  228. package/dist/utils/decode.d.ts +2 -0
  229. package/dist/utils/disabled.d.ts +6 -0
  230. package/dist/utils/hbuilderx.d.ts +5 -0
  231. package/dist/utils/index.d.ts +7 -0
  232. package/dist/utils/nameMatcher.d.ts +4 -0
  233. package/dist/utils/resolve-package.d.ts +1 -0
  234. package/dist/utils/uni-platform.d.ts +11 -0
  235. package/dist/utils-7DUGTFED.mjs +48 -0
  236. package/dist/utils-DmC9_In3.js +61 -0
  237. package/dist/vite-BHpAqldo.js +1952 -0
  238. package/dist/vite-C8JlHiyR.mjs +1940 -0
  239. package/dist/vite.d.ts +4 -17
  240. package/dist/vite.js +5 -14
  241. package/dist/vite.mjs +2 -14
  242. package/dist/weapp-tw-css-import-rewrite-loader.js +59 -92
  243. package/dist/weapp-tw-runtime-classset-loader.js +31 -50
  244. package/dist/webpack-CABjKGGQ.mjs +441 -0
  245. package/dist/webpack-DNIJ0ysE.js +456 -0
  246. package/dist/webpack.d.ts +4 -25
  247. package/dist/webpack.js +6 -17
  248. package/dist/webpack.mjs +2 -17
  249. package/dist/webpack4.d.ts +4 -26
  250. package/dist/webpack4.js +375 -481
  251. package/dist/webpack4.mjs +366 -482
  252. package/dist/wxml/Tokenizer.d.ts +15 -0
  253. package/dist/wxml/custom-attributes.d.ts +4 -0
  254. package/dist/wxml/index.d.ts +2 -0
  255. package/dist/wxml/shared.d.ts +2 -0
  256. package/dist/wxml/tokenizer/types.d.ts +18 -0
  257. package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
  258. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
  259. package/dist/wxml/utils/codegen.d.ts +2 -0
  260. package/dist/wxml/utils/custom-template.d.ts +3 -0
  261. package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
  262. package/dist/wxml/utils/fragment-updater.d.ts +4 -0
  263. package/dist/wxml/utils/template-fragments.d.ts +3 -0
  264. package/dist/wxml/utils.d.ts +8 -0
  265. package/dist/wxml/whitespace.d.ts +2 -0
  266. package/generator-placeholder.css +1 -0
  267. package/package.json +19 -5
  268. package/dist/chunk-24AGZQVR.js +0 -183
  269. package/dist/chunk-3VQKDHGP.mjs +0 -179
  270. package/dist/chunk-4AFQP74Z.js +0 -24
  271. package/dist/chunk-57SOQCAU.mjs +0 -582
  272. package/dist/chunk-5ZYHNDEK.mjs +0 -2439
  273. package/dist/chunk-76S2EME4.mjs +0 -34
  274. package/dist/chunk-A5PB4KZT.js +0 -138
  275. package/dist/chunk-DUHYLR2R.js +0 -276
  276. package/dist/chunk-DYLQ6UOI.js +0 -71
  277. package/dist/chunk-E7I5TW5K.js +0 -52
  278. package/dist/chunk-FS2NOOEB.js +0 -292
  279. package/dist/chunk-HVNGIKLS.js +0 -3930
  280. package/dist/chunk-JZQBZHN5.js +0 -579
  281. package/dist/chunk-KGTVD4EP.mjs +0 -3930
  282. package/dist/chunk-NNOQDMUP.mjs +0 -10
  283. package/dist/chunk-OF6MFURR.js +0 -34
  284. package/dist/chunk-OFB2KBRP.js +0 -2442
  285. package/dist/chunk-OOHJLO5M.mjs +0 -71
  286. package/dist/chunk-PCDYXXSK.mjs +0 -1515
  287. package/dist/chunk-RKISS72P.js +0 -7
  288. package/dist/chunk-RRQZL7FQ.mjs +0 -292
  289. package/dist/chunk-XAKAD2CR.mjs +0 -138
  290. package/dist/chunk-XZP3MREK.mjs +0 -276
  291. package/dist/chunk-ZAA5ZG3D.js +0 -1518
  292. package/dist/chunk-ZCH4YINE.mjs +0 -52
  293. package/dist/cli.d.mts +0 -2
  294. package/dist/core.d.mts +0 -26
  295. package/dist/css-macro/postcss.d.mts +0 -7
  296. package/dist/css-macro.d.mts +0 -18
  297. package/dist/defaults.d.mts +0 -11
  298. package/dist/gulp.d.mts +0 -24
  299. package/dist/index-BXrmQelt.d.mts +0 -672
  300. package/dist/index-BXrmQelt.d.ts +0 -672
  301. package/dist/index.d.mts +0 -15
  302. package/dist/postcss-html-transform.d.mts +0 -2
  303. package/dist/presets.d.mts +0 -76
  304. package/dist/reset.d.mts +0 -1
  305. package/dist/types.d.mts +0 -150
  306. package/dist/vite.d.mts +0 -17
  307. package/dist/webpack.d.mts +0 -25
  308. package/dist/webpack4.d.mts +0 -26
@@ -0,0 +1,456 @@
1
+ const require_chunk = require("./chunk-8l464Juk.js");
2
+ const require_patcher_options = require("./patcher-options-6gJN2EXy.js");
3
+ const require_recorder = require("./recorder-rn_2v_nd.js");
4
+ const require_utils = require("./utils-DmC9_In3.js");
5
+ const require_logger = require("./logger-BZ45DZJT.js");
6
+ const require_generator_css = require("./generator-css-CnYjiMrD.js");
7
+ const require_css_imports = require("./css-imports-BbrbluP9.js");
8
+ const require_loader_anchors = require("./loader-anchors-cprm4Klq.js");
9
+ let node_path = require("node:path");
10
+ node_path = require_chunk.__toESM(node_path);
11
+ let node_process = require("node:process");
12
+ node_process = require_chunk.__toESM(node_process);
13
+ let node_fs = require("node:fs");
14
+ node_fs = require_chunk.__toESM(node_fs);
15
+ //#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets.ts
16
+ function resolveWebpackStaleClassNameFallback(option, _compiler) {
17
+ if (typeof option === "boolean") return option;
18
+ return false;
19
+ }
20
+ function setupWebpackV5ProcessAssetsHook(options) {
21
+ const { compiler, options: compilerOptions, appType, runtimeState, getRuntimeRefreshRequirement, refreshRuntimeMetadata, consumeRuntimeRefreshRequirement, debug } = options;
22
+ const { Compilation, sources } = compiler.webpack;
23
+ const { ConcatSource } = sources;
24
+ const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
25
+ const cssUserHandlerOptionsCache = /* @__PURE__ */ new Map();
26
+ compiler.hooks.compilation.tap(require_recorder.pluginName, (compilation) => {
27
+ compilation.hooks.processAssets.tapPromise({
28
+ name: require_recorder.pluginName,
29
+ stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
30
+ }, async (assets) => {
31
+ compilerOptions.onStart();
32
+ debug("start");
33
+ await runtimeState.patchPromise;
34
+ for (const chunk of compilation.chunks) if (chunk.id && chunk.hash) compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
35
+ const assetHashByChunk = require_loader_anchors.createAssetHashByChunkMap(compilation.chunks);
36
+ const entries = Object.entries(assets);
37
+ const compilerOutputPath = compilation.compiler?.outputPath ?? compiler.outputPath;
38
+ const outputDir = compilerOutputPath ? node_path.default.resolve(compilerOutputPath) : compilation.outputOptions?.path ?? node_process.default.cwd();
39
+ const jsAssets = /* @__PURE__ */ new Map();
40
+ for (const [file] of entries) if (compilerOptions.jsMatcher(file) || compilerOptions.wxsMatcher(file)) {
41
+ const absolute = require_css_imports.toAbsoluteOutputPath(file, outputDir);
42
+ jsAssets.set(absolute, file);
43
+ }
44
+ const moduleGraphOptions = {
45
+ resolve(specifier, importer) {
46
+ return require_css_imports.resolveOutputSpecifier(specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
47
+ },
48
+ load: (id) => {
49
+ const assetName = jsAssets.get(id);
50
+ if (!assetName) return;
51
+ const asset = compilation.getAsset(assetName);
52
+ if (!asset) return;
53
+ const source = asset.source.source();
54
+ return typeof source === "string" ? source : source.toString();
55
+ },
56
+ filter(id) {
57
+ return jsAssets.has(id);
58
+ }
59
+ };
60
+ const applyLinkedResults = (linked) => {
61
+ if (!linked) return;
62
+ for (const [id, { code }] of Object.entries(linked)) {
63
+ const assetName = jsAssets.get(id);
64
+ if (!assetName) continue;
65
+ const asset = compilation.getAsset(assetName);
66
+ if (!asset) continue;
67
+ const previousSource = asset.source.source();
68
+ const previous = typeof previousSource === "string" ? previousSource : previousSource.toString();
69
+ if (previous === code) continue;
70
+ const source = new ConcatSource(code);
71
+ compilation.updateAsset(assetName, source);
72
+ compilerOptions.onUpdate(assetName, previous, code);
73
+ debug("js linked handle: %s", assetName);
74
+ }
75
+ };
76
+ const groupedEntries = require_utils.getGroupedEntries(entries, compilerOptions);
77
+ const getCssHandlerOptions = (file) => {
78
+ const majorVersion = runtimeState.twPatcher.majorVersion;
79
+ const isMainChunk = compilerOptions.mainCssChunkMatcher(file, appType);
80
+ const cacheKey = `${majorVersion ?? "unknown"}:${isMainChunk ? "1" : "0"}:${file}`;
81
+ const cached = cssHandlerOptionsCache.get(cacheKey);
82
+ if (cached) return cached;
83
+ const created = {
84
+ isMainChunk,
85
+ postcssOptions: { options: { from: file } },
86
+ majorVersion
87
+ };
88
+ cssHandlerOptionsCache.set(cacheKey, created);
89
+ return created;
90
+ };
91
+ const getCssUserHandlerOptions = (file) => {
92
+ const cacheKey = `${runtimeState.twPatcher.majorVersion ?? "unknown"}:${file}`;
93
+ const cached = cssUserHandlerOptionsCache.get(cacheKey);
94
+ if (cached) return cached;
95
+ const created = {
96
+ ...getCssHandlerOptions(file),
97
+ isMainChunk: false
98
+ };
99
+ cssUserHandlerOptionsCache.set(cacheKey, created);
100
+ return created;
101
+ };
102
+ const staleClassNameFallback = resolveWebpackStaleClassNameFallback(compilerOptions.staleClassNameFallback, compiler);
103
+ const forceRuntimeRefresh = getRuntimeRefreshRequirement();
104
+ debug("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, runtimeState.twPatcher.majorVersion ?? "unknown");
105
+ const runtimeSet = await require_recorder.ensureRuntimeClassSet(runtimeState, {
106
+ forceRefresh: forceRuntimeRefresh,
107
+ forceCollect: true,
108
+ clearCache: forceRuntimeRefresh,
109
+ allowEmpty: false
110
+ });
111
+ await refreshRuntimeMetadata(forceRuntimeRefresh);
112
+ consumeRuntimeRefreshRequirement();
113
+ const defaultTemplateHandlerOptions = { runtimeSet };
114
+ debug("get runtimeSet, class count: %d", runtimeSet.size);
115
+ const tasks = [];
116
+ if (Array.isArray(groupedEntries.html)) for (const element of groupedEntries.html) {
117
+ const [file, originalSource] = element;
118
+ const rawSource = originalSource.source().toString();
119
+ const cacheKey = file;
120
+ const chunkHash = assetHashByChunk.get(file);
121
+ tasks.push(require_generator_css.processCachedTask({
122
+ cache: compilerOptions.cache,
123
+ cacheKey,
124
+ hashKey: `${file}:asset`,
125
+ rawSource,
126
+ hash: chunkHash,
127
+ applyResult(source) {
128
+ compilation.updateAsset(file, source);
129
+ },
130
+ onCacheHit() {
131
+ debug("html cache hit: %s", file);
132
+ },
133
+ transform: async () => {
134
+ const wxml = await compilerOptions.templateHandler(rawSource, defaultTemplateHandlerOptions);
135
+ const source = new ConcatSource(wxml);
136
+ compilerOptions.onUpdate(file, rawSource, wxml);
137
+ debug("html handle: %s", file);
138
+ return { result: source };
139
+ }
140
+ }));
141
+ }
142
+ const jsTaskFactories = [];
143
+ if (Array.isArray(groupedEntries.js)) for (const [file] of groupedEntries.js) {
144
+ const cacheKey = require_loader_anchors.getCacheKey(file);
145
+ const asset = compilation.getAsset(file);
146
+ if (!asset) continue;
147
+ const absoluteFile = require_css_imports.toAbsoluteOutputPath(file, outputDir);
148
+ const initialSource = asset.source.source();
149
+ const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
150
+ const chunkHash = assetHashByChunk.get(file);
151
+ jsTaskFactories.push(async () => {
152
+ await require_generator_css.processCachedTask({
153
+ cache: compilerOptions.cache,
154
+ cacheKey,
155
+ hashKey: `${file}:asset`,
156
+ rawSource: initialRawSource,
157
+ hash: chunkHash,
158
+ applyResult(source) {
159
+ compilation.updateAsset(file, source);
160
+ },
161
+ onCacheHit() {
162
+ debug("js cache hit: %s", file);
163
+ },
164
+ transform: async () => {
165
+ const currentSourceValue = compilation.getAsset(file)?.source.source();
166
+ const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : currentSourceValue?.toString() ?? "";
167
+ const handlerOptions = {
168
+ staleClassNameFallback,
169
+ tailwindcssMajorVersion: runtimeState.twPatcher.majorVersion,
170
+ filename: absoluteFile,
171
+ moduleGraph: moduleGraphOptions,
172
+ babelParserOptions: { sourceFilename: absoluteFile }
173
+ };
174
+ if (require_recorder.shouldSkipJsTransform(currentSource, handlerOptions)) return { result: new ConcatSource(currentSource) };
175
+ const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
176
+ const source = new ConcatSource(code);
177
+ compilerOptions.onUpdate(file, currentSource, code);
178
+ debug("js handle: %s", file);
179
+ applyLinkedResults(linked);
180
+ return { result: source };
181
+ }
182
+ });
183
+ });
184
+ }
185
+ if (Array.isArray(groupedEntries.css)) for (const element of groupedEntries.css) {
186
+ const [file, originalSource] = element;
187
+ const rawSource = originalSource.source().toString();
188
+ const cacheKey = file;
189
+ const chunkHash = assetHashByChunk.get(file);
190
+ tasks.push(require_generator_css.processCachedTask({
191
+ cache: compilerOptions.cache,
192
+ cacheKey,
193
+ hashKey: `${file}:asset`,
194
+ rawSource,
195
+ hash: chunkHash,
196
+ applyResult(source) {
197
+ compilation.updateAsset(file, source);
198
+ },
199
+ onCacheHit() {
200
+ debug("css cache hit: %s", file);
201
+ },
202
+ transform: async () => {
203
+ await runtimeState.patchPromise;
204
+ const cssHandlerOptions = getCssHandlerOptions(file);
205
+ const generated = await require_generator_css.generateCssByGenerator({
206
+ opts: compilerOptions,
207
+ runtimeState,
208
+ runtime: runtimeSet,
209
+ rawSource,
210
+ file,
211
+ cssHandlerOptions,
212
+ cssUserHandlerOptions: getCssUserHandlerOptions(file),
213
+ styleHandler: compilerOptions.styleHandler,
214
+ debug
215
+ });
216
+ const css = generated?.css ?? (await compilerOptions.styleHandler(rawSource, cssHandlerOptions)).css;
217
+ const source = new ConcatSource(css);
218
+ compilerOptions.onUpdate(file, rawSource, css);
219
+ if (generated) debug("css handle via tailwind v%s engine(%s): %s", runtimeState.twPatcher.majorVersion, generated.target, file);
220
+ else debug("css handle: %s", file);
221
+ return { result: source };
222
+ }
223
+ }));
224
+ }
225
+ require_css_imports.pushConcurrentTaskFactories(tasks, jsTaskFactories);
226
+ await Promise.all(tasks);
227
+ debug("end");
228
+ compilerOptions.onEnd();
229
+ });
230
+ });
231
+ }
232
+ //#endregion
233
+ //#region src/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.ts
234
+ function setupWebpackV5Loaders(options) {
235
+ const { compiler, options: compilerOptions, appType, weappTailwindcssPackageDir, shouldRewriteCssImports, runtimeLoaderPath, runtimeCssImportRewriteLoaderPath, getClassSetInLoader, getRuntimeWatchDependencies, debug } = options;
236
+ const isMpxApp = require_loader_anchors.isMpx(appType);
237
+ if (shouldRewriteCssImports && isMpxApp) require_loader_anchors.ensureMpxTailwindcssAliases(compiler, weappTailwindcssPackageDir);
238
+ const runtimeClassSetLoader = runtimeLoaderPath ?? node_path.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js");
239
+ const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? runtimeCssImportRewriteLoaderPath ?? node_path.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js") : void 0;
240
+ const runtimeClassSetLoaderExists = node_fs.default.existsSync(runtimeClassSetLoader);
241
+ const runtimeCssImportRewriteLoaderExists = runtimeCssImportRewriteLoader ? node_fs.default.existsSync(runtimeCssImportRewriteLoader) : false;
242
+ const runtimeLoaderRewriteOptions = shouldRewriteCssImports ? {
243
+ pkgDir: weappTailwindcssPackageDir,
244
+ appType
245
+ } : void 0;
246
+ const classSetLoaderOptions = {
247
+ getClassSet: getClassSetInLoader,
248
+ getWatchDependencies: getRuntimeWatchDependencies
249
+ };
250
+ const { findRewriteAnchor, findClassSetAnchor } = require_loader_anchors.createLoaderAnchorFinders(appType);
251
+ const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? { rewriteCssImports: runtimeLoaderRewriteOptions } : void 0;
252
+ if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) require_loader_anchors.injectMpxCssRewritePreRules(compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
253
+ const createRuntimeClassSetLoaderEntry = () => ({
254
+ loader: runtimeClassSetLoader,
255
+ options: classSetLoaderOptions,
256
+ ident: null,
257
+ type: null
258
+ });
259
+ const createCssImportRewriteLoaderEntry = () => {
260
+ if (!runtimeCssImportRewriteLoader) return null;
261
+ return {
262
+ loader: runtimeCssImportRewriteLoader,
263
+ options: cssImportRewriteLoaderOptions,
264
+ ident: null,
265
+ type: null
266
+ };
267
+ };
268
+ const { NormalModule } = compiler.webpack;
269
+ compiler.hooks.compilation.tap(require_recorder.pluginName, (compilation) => {
270
+ NormalModule.getCompilationHooks(compilation).loader.tap(require_recorder.pluginName, (_loaderContext, module) => {
271
+ if (!(runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists)) return;
272
+ require_loader_anchors.patchMpxLoaderResolve(_loaderContext, weappTailwindcssPackageDir, shouldRewriteCssImports && isMpxApp);
273
+ const loaderEntries = module.loaders || [];
274
+ let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
275
+ const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
276
+ const isCssModule = require_loader_anchors.isCssLikeModuleResource(module.resource, compilerOptions.cssMatcher, appType);
277
+ if (node_process.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), {
278
+ rewriteAnchorIdx,
279
+ classSetAnchorIdx
280
+ });
281
+ if (node_process.default.env.WEAPP_TW_LOADER_DEBUG && typeof module.resource === "string" && module.resource.includes("app.css")) debug("app.css module loaders=%o anchors=%o", loaderEntries.map((x) => x.loader), {
282
+ rewriteAnchorIdx,
283
+ classSetAnchorIdx
284
+ });
285
+ else if (node_process.default.env.WEAPP_TW_LOADER_DEBUG && typeof module.resource === "string" && module.resource.endsWith(".css")) debug("css module seen: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), {
286
+ rewriteAnchorIdx,
287
+ classSetAnchorIdx
288
+ });
289
+ if (rewriteAnchorIdx === -1 && classSetAnchorIdx === -1 && !isCssModule) return;
290
+ const anchorlessInsert = (entry, position) => {
291
+ if (position === "after") loaderEntries.push(entry);
292
+ else loaderEntries.unshift(entry);
293
+ };
294
+ if (cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoaderExists && runtimeCssImportRewriteLoader) {
295
+ const existingIndex = loaderEntries.findIndex((entry) => entry.loader?.includes?.(runtimeCssImportRewriteLoader));
296
+ const rewriteLoaderEntry = existingIndex !== -1 ? loaderEntries.splice(existingIndex, 1)[0] : createCssImportRewriteLoaderEntry();
297
+ if (rewriteLoaderEntry) {
298
+ const anchorIndex = findRewriteAnchor(loaderEntries);
299
+ if (anchorIndex === -1) anchorlessInsert(rewriteLoaderEntry, "after");
300
+ else loaderEntries.splice(anchorIndex + 1, 0, rewriteLoaderEntry);
301
+ rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
302
+ }
303
+ }
304
+ if (runtimeClassSetLoaderExists && !require_loader_anchors.hasLoaderEntry(loaderEntries, runtimeClassSetLoader)) {
305
+ const classSetLoaderEntry = createRuntimeClassSetLoaderEntry();
306
+ const anchorIndex = findClassSetAnchor(loaderEntries);
307
+ if (anchorIndex === -1) anchorlessInsert(classSetLoaderEntry, "before");
308
+ else {
309
+ const insertIndex = anchorIndex === -1 ? rewriteAnchorIdx : anchorIndex;
310
+ loaderEntries.splice(insertIndex, 0, classSetLoaderEntry);
311
+ }
312
+ }
313
+ });
314
+ });
315
+ }
316
+ //#endregion
317
+ //#region src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
318
+ const debug = require_recorder.createDebug();
319
+ const weappTailwindcssPackageDir = require_css_imports.resolvePackageDir("weapp-tailwindcss");
320
+ /**
321
+ * @name UnifiedWebpackPluginV5
322
+ * @description webpack5 核心转义插件
323
+ * @link https://tw.icebreaker.top/docs/intro
324
+ */
325
+ var UnifiedWebpackPluginV5 = class {
326
+ constructor(options = {}) {
327
+ this.options = require_recorder.getCompilerContext(options);
328
+ this.appType = this.options.appType;
329
+ }
330
+ apply(compiler) {
331
+ compiler.options = compiler.options || {};
332
+ const { disabled, onLoad, runtimeLoaderPath, runtimeCssImportRewriteLoaderPath, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = this.options;
333
+ const disabledOptions = require_css_imports.resolveDisabledOptions(disabled);
334
+ const shouldRewriteCssImports = (initialTwPatcher.majorVersion ?? 0) >= 4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
335
+ const isMpxApp = require_loader_anchors.isMpx(this.appType);
336
+ if (shouldRewriteCssImports) {
337
+ require_loader_anchors.applyTailwindcssCssImportRewrite(compiler, {
338
+ pkgDir: weappTailwindcssPackageDir,
339
+ enabled: true,
340
+ appType: this.appType
341
+ });
342
+ require_loader_anchors.setupMpxTailwindcssRedirect(weappTailwindcssPackageDir, isMpxApp);
343
+ }
344
+ if (disabledOptions.plugin) return;
345
+ const patchRecorderState = require_recorder.setupPatchRecorder(initialTwPatcher, this.options.tailwindcssBasedir, {
346
+ source: "runtime",
347
+ cwd: this.options.tailwindcssBasedir ?? node_process.default.cwd()
348
+ });
349
+ const runtimeState = {
350
+ twPatcher: initialTwPatcher,
351
+ patchPromise: patchRecorderState.patchPromise,
352
+ refreshTailwindcssPatcher,
353
+ onPatchCompleted: patchRecorderState.onPatchCompleted
354
+ };
355
+ let runtimeSetPrepared = false;
356
+ let runtimeSetSignature;
357
+ let runtimeRefreshRequiredForCompilation = false;
358
+ const runtimeWatchDependencyFiles = /* @__PURE__ */ new Set();
359
+ const runtimeWatchDependencyContexts = /* @__PURE__ */ new Set();
360
+ let runtimeMetadataPrepared = false;
361
+ const updateRuntimeWatchDependencies = async () => {
362
+ runtimeWatchDependencyFiles.clear();
363
+ runtimeWatchDependencyContexts.clear();
364
+ const tailwindOptions = require_patcher_options.resolveTailwindcssOptions(runtimeState.twPatcher.options);
365
+ if (tailwindOptions?.config) runtimeWatchDependencyFiles.add(tailwindOptions.config);
366
+ for (const entry of tailwindOptions?.v4?.cssEntries ?? []) runtimeWatchDependencyFiles.add(entry);
367
+ for (const source of tailwindOptions?.v4?.sources ?? []) if (source?.base) runtimeWatchDependencyContexts.add(source.base);
368
+ if (typeof runtimeState.twPatcher.collectContentTokens !== "function") return;
369
+ try {
370
+ const report = await runtimeState.twPatcher.collectContentTokens();
371
+ for (const entry of report.entries ?? []) if (entry.file) runtimeWatchDependencyFiles.add(entry.file);
372
+ for (const source of report.sources ?? []) if (source?.base) runtimeWatchDependencyContexts.add(source.base);
373
+ } catch (error) {
374
+ debug("collect runtime watch dependencies failed: %O", error);
375
+ }
376
+ };
377
+ const ensureRuntimeMetadata = async (force = false) => {
378
+ if (runtimeMetadataPrepared && !force) return;
379
+ await updateRuntimeWatchDependencies();
380
+ runtimeMetadataPrepared = true;
381
+ };
382
+ const syncRuntimeRefreshRequirement = () => {
383
+ runtimeRefreshRequiredForCompilation = runtimeRefreshRequiredForCompilation || require_loader_anchors.hasWatchChanges(compiler);
384
+ };
385
+ const resetRuntimePreparation = () => {
386
+ runtimeSetPrepared = false;
387
+ runtimeMetadataPrepared = false;
388
+ syncRuntimeRefreshRequirement();
389
+ };
390
+ compiler.hooks.invalid?.tap?.(require_recorder.pluginName, () => {
391
+ runtimeRefreshRequiredForCompilation = true;
392
+ });
393
+ compiler.hooks.watchRun?.tap?.(require_recorder.pluginName, syncRuntimeRefreshRequirement);
394
+ if (compiler.hooks.thisCompilation?.tap) compiler.hooks.thisCompilation.tap(require_recorder.pluginName, resetRuntimePreparation);
395
+ else if (compiler.hooks.compilation?.tap) compiler.hooks.compilation.tap(require_recorder.pluginName, resetRuntimePreparation);
396
+ async function getClassSetInLoader() {
397
+ if (runtimeSetPrepared) return;
398
+ const signature = require_logger.getRuntimeClassSetSignature(runtimeState.twPatcher);
399
+ const forceRefresh = runtimeRefreshRequiredForCompilation || signature !== runtimeSetSignature;
400
+ debug("runtime loader ensure class set forceRefresh=%s watchDirty=%s signatureChanged=%s", forceRefresh, runtimeRefreshRequiredForCompilation, signature !== runtimeSetSignature);
401
+ runtimeSetPrepared = true;
402
+ await require_recorder.ensureRuntimeClassSet(runtimeState, {
403
+ forceRefresh,
404
+ forceCollect: true,
405
+ clearCache: forceRefresh,
406
+ allowEmpty: true
407
+ });
408
+ await ensureRuntimeMetadata(forceRefresh);
409
+ runtimeSetSignature = signature;
410
+ runtimeRefreshRequiredForCompilation = false;
411
+ }
412
+ onLoad();
413
+ setupWebpackV5Loaders({
414
+ compiler,
415
+ options: this.options,
416
+ appType: this.appType,
417
+ weappTailwindcssPackageDir,
418
+ shouldRewriteCssImports,
419
+ runtimeLoaderPath,
420
+ runtimeCssImportRewriteLoaderPath,
421
+ getClassSetInLoader,
422
+ getRuntimeWatchDependencies() {
423
+ return {
424
+ files: runtimeWatchDependencyFiles,
425
+ contexts: runtimeWatchDependencyContexts
426
+ };
427
+ },
428
+ debug
429
+ });
430
+ setupWebpackV5ProcessAssetsHook({
431
+ compiler,
432
+ options: this.options,
433
+ appType: this.appType,
434
+ runtimeState,
435
+ getRuntimeRefreshRequirement: () => runtimeRefreshRequiredForCompilation,
436
+ refreshRuntimeMetadata: ensureRuntimeMetadata,
437
+ consumeRuntimeRefreshRequirement() {
438
+ runtimeRefreshRequiredForCompilation = false;
439
+ },
440
+ debug
441
+ });
442
+ }
443
+ };
444
+ //#endregion
445
+ Object.defineProperty(exports, "UnifiedWebpackPluginV5", {
446
+ enumerable: true,
447
+ get: function() {
448
+ return UnifiedWebpackPluginV5;
449
+ }
450
+ });
451
+ Object.defineProperty(exports, "weappTailwindcssPackageDir", {
452
+ enumerable: true,
453
+ get: function() {
454
+ return weappTailwindcssPackageDir;
455
+ }
456
+ });
package/dist/webpack.d.ts CHANGED
@@ -1,25 +1,4 @@
1
- import { Compiler } from 'webpack';
2
- import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
3
- import { A as AppType, e as UserDefinedOptions } from './index-BXrmQelt.js';
4
- import '@babel/parser';
5
- import '@weapp-tailwindcss/postcss/types';
6
- import 'magic-string';
7
- import 'postcss';
8
- import 'tailwindcss-patch';
9
- import 'node:buffer';
10
- import 'lru-cache';
11
-
12
- declare const weappTailwindcssPackageDir: string;
13
- /**
14
- * @name UnifiedWebpackPluginV5
15
- * @description webpack5 核心转义插件
16
- * @link https://tw.icebreaker.top/docs/intro
17
- */
18
- declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
19
- options: InternalUserDefinedOptions;
20
- appType?: AppType;
21
- constructor(options?: UserDefinedOptions);
22
- apply(compiler: Compiler): void;
23
- }
24
-
25
- export { UnifiedWebpackPluginV5, UserDefinedOptions, UnifiedWebpackPluginV5 as weappTailwindcss, weappTailwindcssPackageDir };
1
+ export * from './bundlers/webpack/index';
2
+ export { UnifiedWebpackPluginV5 as WeappTailwindcss } from './bundlers/webpack/index';
3
+ export { UnifiedWebpackPluginV5 as weappTailwindcss } from './bundlers/webpack/index';
4
+ export type { UserDefinedOptions } from './types';
package/dist/webpack.js CHANGED
@@ -1,17 +1,6 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkJZQBZHN5js = require('./chunk-JZQBZHN5.js');
5
- require('./chunk-FS2NOOEB.js');
6
- require('./chunk-24AGZQVR.js');
7
- require('./chunk-OF6MFURR.js');
8
- require('./chunk-HVNGIKLS.js');
9
- require('./chunk-ZAA5ZG3D.js');
10
- require('./chunk-A5PB4KZT.js');
11
- require('./chunk-DYLQ6UOI.js');
12
- require('./chunk-RKISS72P.js');
13
-
14
-
15
-
16
-
17
- exports.UnifiedWebpackPluginV5 = _chunkJZQBZHN5js.UnifiedWebpackPluginV5; exports.weappTailwindcss = _chunkJZQBZHN5js.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkJZQBZHN5js.weappTailwindcssPackageDir;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_webpack = require("./webpack-DNIJ0ysE.js");
3
+ exports.UnifiedWebpackPluginV5 = require_webpack.UnifiedWebpackPluginV5;
4
+ exports.WeappTailwindcss = require_webpack.UnifiedWebpackPluginV5;
5
+ exports.weappTailwindcss = require_webpack.UnifiedWebpackPluginV5;
6
+ exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
package/dist/webpack.mjs CHANGED
@@ -1,17 +1,2 @@
1
- import {
2
- UnifiedWebpackPluginV5,
3
- weappTailwindcssPackageDir
4
- } from "./chunk-57SOQCAU.mjs";
5
- import "./chunk-RRQZL7FQ.mjs";
6
- import "./chunk-3VQKDHGP.mjs";
7
- import "./chunk-76S2EME4.mjs";
8
- import "./chunk-KGTVD4EP.mjs";
9
- import "./chunk-PCDYXXSK.mjs";
10
- import "./chunk-XAKAD2CR.mjs";
11
- import "./chunk-OOHJLO5M.mjs";
12
- import "./chunk-NNOQDMUP.mjs";
13
- export {
14
- UnifiedWebpackPluginV5,
15
- UnifiedWebpackPluginV5 as weappTailwindcss,
16
- weappTailwindcssPackageDir
17
- };
1
+ import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-CABjKGGQ.mjs";
2
+ export { UnifiedWebpackPluginV5, UnifiedWebpackPluginV5 as WeappTailwindcss, UnifiedWebpackPluginV5 as weappTailwindcss, weappTailwindcssPackageDir };
@@ -1,26 +1,4 @@
1
- import { Compiler } from 'webpack4';
2
- import { IBaseWebpackPlugin, InternalUserDefinedOptions } from './types.js';
3
- import { A as AppType, e as UserDefinedOptions } from './index-BXrmQelt.js';
4
- import '@babel/parser';
5
- import '@weapp-tailwindcss/postcss/types';
6
- import 'magic-string';
7
- import 'postcss';
8
- import 'tailwindcss-patch';
9
- import 'node:buffer';
10
- import 'webpack';
11
- import 'lru-cache';
12
-
13
- declare const weappTailwindcssPackageDir: string;
14
- /**
15
- * @name UnifiedWebpackPluginV4
16
- * @description webpack4 核心转义插件
17
- * @link https://tw.icebreaker.top/docs/intro
18
- */
19
- declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
20
- options: InternalUserDefinedOptions;
21
- appType?: AppType;
22
- constructor(options?: UserDefinedOptions);
23
- apply(compiler: Compiler): void;
24
- }
25
-
26
- export { UnifiedWebpackPluginV4, UserDefinedOptions, UnifiedWebpackPluginV4 as weappTailwindcss, weappTailwindcssPackageDir };
1
+ export * from './bundlers/webpack/BaseUnifiedPlugin/v4';
2
+ export { UnifiedWebpackPluginV4 as WeappTailwindcss } from './bundlers/webpack/BaseUnifiedPlugin/v4';
3
+ export { UnifiedWebpackPluginV4 as weappTailwindcss } from './bundlers/webpack/BaseUnifiedPlugin/v4';
4
+ export type { UserDefinedOptions } from './types';