weapp-tailwindcss 5.5.5 → 5.5.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 (133) hide show
  1. package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +5 -4
  2. package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -2
  3. package/dist/bundlers/shared/framework-css-composition.d.ts +1 -0
  4. package/dist/bundlers/shared/framework-postcss.d.ts +2 -1
  5. package/dist/bundlers/shared/framework-user-css.d.ts +1 -0
  6. package/dist/bundlers/shared/generated-css-marker.d.ts +1 -0
  7. package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +5 -7
  8. package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +4 -1
  9. package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -4
  10. package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
  11. package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +4 -2
  12. package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -1
  13. package/dist/bundlers/shared/generator-css/types.d.ts +6 -3
  14. package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -0
  15. package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +4 -0
  16. package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +3 -1
  17. package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -1
  18. package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +3 -0
  19. package/dist/bundlers/shared/style-handler-options.d.ts +7 -0
  20. package/dist/bundlers/shared/v4-generation-core.d.ts +0 -1
  21. package/dist/bundlers/vite/css-finalizer/css-calc.d.ts +3 -0
  22. package/dist/bundlers/vite/css-finalizer/final-assets.d.ts +3 -0
  23. package/dist/bundlers/vite/css-handler-options.d.ts +1 -1
  24. package/dist/bundlers/vite/frameworks/generic/web.d.ts +2 -1
  25. package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +1 -0
  26. package/dist/bundlers/vite/generate-bundle/finalize/sync-processed-css.d.ts +4 -0
  27. package/dist/bundlers/vite/generate-bundle/framework-style-memory.d.ts +4 -0
  28. package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +7 -0
  29. package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -0
  30. package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +1 -1
  31. package/dist/bundlers/vite/generate-bundle/runtime.d.ts +3 -1
  32. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +1 -1
  33. package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +2 -2
  34. package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -1
  35. package/dist/bundlers/vite/generate-bundle/web-css-module.d.ts +1 -0
  36. package/dist/bundlers/vite/plugin-hook.d.ts +3 -0
  37. package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +3 -1
  38. package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +1 -1
  39. package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -1
  40. package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +3 -1
  41. package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -1
  42. package/dist/bundlers/vite/shared/framework-runtime-configuration.d.ts +3 -0
  43. package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +9 -0
  44. package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +6 -5
  45. package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +3 -3
  46. package/dist/bundlers/vite/shared/framework-strategy.d.ts +3 -1
  47. package/dist/bundlers/vite/shared/hmr-source.d.ts +2 -0
  48. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +2 -1
  49. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  50. package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +1 -1
  51. package/dist/compiler/index.d.ts +2 -0
  52. package/dist/compiler/semantic-css.d.ts +1 -1
  53. package/dist/compiler/types.d.ts +1 -1
  54. package/dist/{compiler-Cc0JXfbw.cjs → compiler-C8FqI-P3.cjs} +17378 -40552
  55. package/dist/{compiler-D_vxtEdw.js → compiler-D3GBwxoa.js} +32 -23
  56. package/dist/core/compiler/transforms.d.ts +1 -1
  57. package/dist/core.cjs +4 -4
  58. package/dist/core.js +4 -4
  59. package/dist/{css-imports-FRZwX4P6.cjs → css-imports-XvtI1zCY.cjs} +2 -3
  60. package/dist/css-macro.cjs +1 -1
  61. package/dist/css-macro.js +1 -1
  62. package/dist/{defaults-CKx-4LcW.js → defaults-AQuvJS-h.js} +4 -2
  63. package/dist/{defaults-CiGsr8Xq.cjs → defaults-CyX5iO9y.cjs} +4 -2
  64. package/dist/defaults.cjs +1 -1
  65. package/dist/defaults.js +1 -1
  66. package/dist/final-css-cleanup-CDTmVAye.cjs +1 -0
  67. package/dist/{final-css-cleanup-B0HUBtiE.js → final-css-cleanup-u_sI2p56.js} +1 -126
  68. package/dist/framework/index.d.ts +1 -1
  69. package/dist/framework/platform.d.ts +2 -2
  70. package/dist/{generator-BdSIvFEO.cjs → generator-Bvr4WmuF.cjs} +135 -149
  71. package/dist/{generator-CAOx1Sqm.js → generator-C0BJjyLM.js} +116 -130
  72. package/dist/generator.cjs +1 -1
  73. package/dist/generator.js +1 -1
  74. package/dist/{gulp-Dnt8VL8D.cjs → gulp-BExe5RBF.cjs} +8 -8
  75. package/dist/{gulp-B1mPTMqw.js → gulp-BhkIIk7J.js} +5 -5
  76. package/dist/gulp.cjs +1 -1
  77. package/dist/gulp.js +1 -1
  78. package/dist/{hmr-timing-wAt0LavM.js → hmr-timing-B9Yt86-U.js} +299 -404
  79. package/dist/{hmr-timing-qpX410qU.cjs → hmr-timing-CoiJIqDu.cjs} +4 -4
  80. package/dist/index.cjs +4 -4
  81. package/dist/index.js +4 -4
  82. package/dist/js/NodePathWalker.d.ts +1 -1
  83. package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
  84. package/dist/js/node-path-walker/import-tokens.d.ts +1 -1
  85. package/dist/{pipeline-helpers-BHagysZY.cjs → pipeline-helpers-BOjTEmMi.cjs} +6 -6
  86. package/dist/postcss.cjs +1 -1
  87. package/dist/postcss.js +1 -1
  88. package/dist/presets.cjs +2 -2
  89. package/dist/presets.js +2 -2
  90. package/dist/rspack.cjs +2 -2
  91. package/dist/rspack.js +2 -2
  92. package/dist/{scoped-generator-BqxVxNp9.js → scoped-generator-B6Y1bxzM.js} +46 -31
  93. package/dist/{scoped-generator-CtetE5rm.cjs → scoped-generator-BUBls_oM.cjs} +46 -31
  94. package/dist/{source-candidate-scan-signature-BDGB9nKZ.cjs → source-candidate-scan-signature-BtJZp28T.cjs} +32 -3
  95. package/dist/{source-candidate-scan-signature-Lm32zKVA.js → source-candidate-scan-signature-DNuGKTqf.js} +21 -4
  96. package/dist/style-injector/internal.d.ts +118 -8
  97. package/dist/style-injector/options.d.ts +5 -1
  98. package/dist/tailwindcss/runtime-options.d.ts +5 -0
  99. package/dist/tailwindcss/v4/preflight.d.ts +0 -1
  100. package/dist/tailwindcss/v4-engine/generator/style-context.d.ts +1 -3
  101. package/dist/{tailwindcss-DTV9MoJT.js → tailwindcss-B_4E52WF.js} +7 -13
  102. package/dist/{tailwindcss-9e6ZuYgS.cjs → tailwindcss-CBYjzRmV.cjs} +4 -10
  103. package/dist/{transform-BbbZvFQq.js → transform-CkEnJYIP.js} +18 -12
  104. package/dist/{transform-D21f8Dm8.cjs → transform-FkqbTBJR.cjs} +17 -11
  105. package/dist/types/index.d.ts +3 -2
  106. package/dist/uni-app-x/border-preflight.d.ts +1 -2
  107. package/dist/uni-app-x/component-local-style.d.ts +2 -1
  108. package/dist/uni-app-x/transform.d.ts +4 -2
  109. package/dist/uni-app-x/vite/author-apply.d.ts +3 -1
  110. package/dist/uni-app-x/vite/native-hmr.d.ts +1 -1
  111. package/dist/uni-app-x/vite/style-result.d.ts +5 -0
  112. package/dist/{v4-generation-core-DJBWZ_D0.cjs → v4-generation-core-Cz1D7wm1.cjs} +313 -418
  113. package/dist/vite/web.cjs +1 -1
  114. package/dist/vite/web.js +1 -1
  115. package/dist/{vite-CaH7WjX6.cjs → vite-DxuKPZlp.cjs} +565 -592
  116. package/dist/{vite-CuYntLZP.js → vite-lP35OguX.js} +558 -578
  117. package/dist/vite-web.d.ts +1 -1
  118. package/dist/vite.cjs +1 -1
  119. package/dist/vite.js +1 -1
  120. package/dist/weapp-tw-css-generation-loader.cjs +2 -2
  121. package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
  122. package/dist/{web-CdXkY_VO.js → web-Dfz_jpNj.js} +144 -107
  123. package/dist/{web-CYs2Kcaa.cjs → web-DhDxhlkq.cjs} +156 -107
  124. package/dist/{webpack-BnCSOUuu.js → webpack-D6jp1o3m.js} +18 -17
  125. package/dist/{webpack-BQNnpQPC.cjs → webpack-R2Sbggiy.cjs} +20 -20
  126. package/dist/webpack.cjs +1 -1
  127. package/dist/webpack.js +1 -1
  128. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
  129. package/dist/wxml/utils/custom-template.d.ts +1 -1
  130. package/package.json +8 -10
  131. package/dist/final-css-cleanup-DSjczga3.cjs +0 -138
  132. package/dist/tailwindcss/v4-engine/css-import.d.ts +0 -14
  133. package/dist/uni-app-x/style-asset/source-parser.d.ts +0 -2
@@ -1,15 +1,15 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
2
- const require_generator = require("./generator-BdSIvFEO.cjs");
3
- const require_tailwindcss = require("./tailwindcss-9e6ZuYgS.cjs");
2
+ const require_generator = require("./generator-Bvr4WmuF.cjs");
3
+ const require_tailwindcss = require("./tailwindcss-CBYjzRmV.cjs");
4
4
  const require_utils = require("./utils-CuKLf1Zv.cjs");
5
- const require_v4_generation_core = require("./v4-generation-core-DJBWZ_D0.cjs");
6
- const require_compiler = require("./compiler-Cc0JXfbw.cjs");
5
+ const require_v4_generation_core = require("./v4-generation-core-Cz1D7wm1.cjs");
6
+ const require_compiler = require("./compiler-C8FqI-P3.cjs");
7
7
  const require_runtime_state = require("./runtime-state-XYSycuGu.cjs");
8
8
  const require_cache = require("./cache-CBJFB1HN.cjs");
9
- const require_hmr_timing = require("./hmr-timing-qpX410qU.cjs");
10
- const require_scoped_generator = require("./scoped-generator-CtetE5rm.cjs");
11
- const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-BDGB9nKZ.cjs");
12
- const require_pipeline_helpers = require("./pipeline-helpers-BHagysZY.cjs");
9
+ const require_hmr_timing = require("./hmr-timing-CoiJIqDu.cjs");
10
+ const require_scoped_generator = require("./scoped-generator-BUBls_oM.cjs");
11
+ const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-BtJZp28T.cjs");
12
+ const require_pipeline_helpers = require("./pipeline-helpers-BOjTEmMi.cjs");
13
13
  const require_css_loader_runtime = require("./css-loader-runtime-DGqsWVua.cjs");
14
14
  const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
15
15
  let node_fs = require("node:fs");
@@ -186,7 +186,7 @@ function dirnameWebpackResourcePath(file) {
186
186
  return node_path.default.dirname(file);
187
187
  }
188
188
  function resolveWebpackCssAssetModuleResource(resource, issuer, options) {
189
- if (!isCssLikeModuleResource(resource, options.cssMatcher, options.appType)) return;
189
+ if (!isCssLikeModuleResource(resource, options.cssMatcher)) return;
190
190
  const normalized = stripResourceQuery(resource);
191
191
  if (!normalized) return;
192
192
  const absoluteResource = resolveWebpackResourcePath(normalized);
@@ -642,7 +642,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
642
642
  for (const dependency of loaderGeneratedCss.dependencies) compilation.fileDependencies?.add?.(dependency);
643
643
  const currentRawSourceWithoutBundlerMarkers = require_v4_generation_core.stripBundlerGeneratedCssMarkers(currentRawSource);
644
644
  const currentAssetHasProcessedUrl = require_pipeline_helpers.hasProcessedCssAssetUrl(currentRawSourceWithoutBundlerMarkers) && currentRawSourceWithoutBundlerMarkers !== loaderGeneratedCss.css;
645
- const currentAssetUserCss = currentAssetHasProcessedUrl ? currentRawSourceWithoutBundlerMarkers : require_pipeline_helpers.shouldUseWebpackAssetAsGeneratorUserCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css, { processed: true }) ? require_v4_generation_core.removeGeneratedSelectorCompatCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css) : void 0;
645
+ const currentAssetUserCss = currentAssetHasProcessedUrl ? currentRawSourceWithoutBundlerMarkers : require_pipeline_helpers.shouldUseWebpackAssetAsGeneratorUserCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css, { processed: true }) ? (0, _weapp_tailwindcss_postcss.removeGeneratedSelectorCompatCss)(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css) : void 0;
646
646
  const loaderGeneratedCssWithoutMarkers = require_v4_generation_core.stripBundlerGeneratedCssMarkers(loaderGeneratedCss.css);
647
647
  const currentAssetUserCssWithoutMarkers = currentAssetUserCss === void 0 ? "" : require_v4_generation_core.stripBundlerGeneratedCssMarkers(currentAssetUserCss);
648
648
  const currentAssetMissingUserCss = !(currentAssetUserCssWithoutMarkers.trim().length > 0 && !require_generator.isCommentOnlyCss(currentAssetUserCssWithoutMarkers)) ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCssWithoutMarkers, loaderGeneratedCssWithoutMarkers);
@@ -655,7 +655,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
655
655
  return { result: new ConcatSource(finalizeTracedCss(userCss, cssHandlerOptions)) };
656
656
  }
657
657
  const mergedLoaderCss = currentAssetUserCss === void 0 ? loaderGeneratedCss.css : require_pipeline_helpers.createWebpackGeneratorUserCssSourceAppend({
658
- css: currentAssetUserCss === void 0 ? loaderGeneratedCss.css : currentAssetHasProcessedUrl ? require_v4_generation_core.removeGeneratedSelectorCompatCss(loaderGeneratedCss.css, currentAssetUserCss) : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCss, loaderGeneratedCss.css),
658
+ css: currentAssetUserCss === void 0 ? loaderGeneratedCss.css : currentAssetHasProcessedUrl ? (0, _weapp_tailwindcss_postcss.removeGeneratedSelectorCompatCss)(loaderGeneratedCss.css, currentAssetUserCss) : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCss, loaderGeneratedCss.css),
659
659
  processed: true
660
660
  }, currentAssetUserCss === void 0 ? void 0 : {
661
661
  css: currentAssetUserCss,
@@ -1744,8 +1744,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
1744
1744
  debug
1745
1745
  });
1746
1746
  for (const [file, asset] of groupedEntries.css) {
1747
- const rawSource = compilation.getAsset(file)?.source.source() ?? asset.source();
1748
- const source = require_pipeline_helpers.stringifyWebpackSourceLike(rawSource);
1747
+ const source = (compilation.getAsset(file)?.source.source() ?? asset.source()).toString();
1749
1748
  updateAssetIfChanged(file, require_pipeline_helpers.finalizeWebpackCssAssetOutputSource(source, compilerOptions, isWebGeneratorTarget));
1750
1749
  }
1751
1750
  });
@@ -1961,7 +1960,7 @@ function addMpxWebpackPluginAlias(alias, pkgDir) {
1961
1960
  }
1962
1961
  ];
1963
1962
  const managedNames = new Set(entries.filter((entry) => typeof entry.name === "string").map((entry) => entry.name));
1964
- const managedPatterns = new Set(entries.filter((entry) => entry.name instanceof RegExp).map((entry) => `${entry.name.source}/${entry.name.flags}`));
1963
+ const managedPatterns = new Set(entries.flatMap((entry) => entry.name instanceof RegExp ? [`${entry.name.source}/${entry.name.flags}`] : []));
1965
1964
  for (let index = alias.length - 1; index >= 0; index--) {
1966
1965
  const name = alias[index]?.name;
1967
1966
  if (managedNames.has(name) || name instanceof RegExp && managedPatterns.has(`${name.source}/${name.flags}`)) alias.splice(index, 1);
@@ -2233,7 +2232,7 @@ function setupWebpackV5Loaders(options) {
2233
2232
  const isLynxMainThreadCss = compilerOptions.platform === "lynx" && (module.layer === "react:main-thread" || loaderEntries.some((entry) => entry.loader?.includes?.("ignore-css-loader")));
2234
2233
  let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
2235
2234
  const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
2236
- const isCssModule = isCssLikeModuleResource(module.resource, compilerOptions.cssMatcher, appType);
2235
+ const isCssModule = isCssLikeModuleResource(module.resource, compilerOptions.cssMatcher);
2237
2236
  if (isCssModule) {
2238
2237
  const frameworkPostcssOptions = require_v4_generation_core.collectFrameworkPostcssOptionsFromLoaderEntries(loaderEntries, _loaderContext);
2239
2238
  if (frameworkPostcssOptions) require_v4_generation_core.captureResolvedFrameworkPostcssOptions(compilerOptions, frameworkPostcssOptions);
@@ -2264,7 +2263,7 @@ function setupWebpackV5Loaders(options) {
2264
2263
  if (cssImportRewriteLoaderOptions && runtimeCssImportRewriteLoaderExists && runtimeCssImportRewriteLoader && isCssModule && !isLynxMainThreadCss) {
2265
2264
  const existingIndex = loaderEntries.findIndex((entry) => entry.loader?.includes?.(runtimeCssImportRewriteLoader));
2266
2265
  const existingOptions = existingIndex === -1 ? void 0 : loaderEntries[existingIndex]?.options;
2267
- const generateInRegisteredLoader = typeof existingOptions === "object" && existingOptions !== null && "generateCss" in existingOptions && existingOptions.generateCss === true;
2266
+ const generateInRegisteredLoader = typeof existingOptions === "object" && existingOptions !== null && "generateCss" in existingOptions && existingOptions["generateCss"] === true;
2268
2267
  const rewriteLoaderEntry = existingIndex !== -1 ? {
2269
2268
  ...loaderEntries.splice(existingIndex, 1)[0],
2270
2269
  loader: runtimeCssImportRewriteLoader,
@@ -2331,6 +2330,7 @@ function appendIgnoredPath(ignored, ignoredPath) {
2331
2330
  return createOutputIgnoredPredicate(normalizeIgnoredList(ignored), ignoredPath);
2332
2331
  }
2333
2332
  function setupWebpackWatchOutputIgnore(compiler) {
2333
+ const compilerOptions = compiler.options;
2334
2334
  const appendOutputIgnoredPath = (watchOptions, outputPath) => {
2335
2335
  const resolvedOutputPath = outputPath || compiler.outputPath || compiler.options?.output?.path;
2336
2336
  const paths = resolvedOutputPath && node_path.default.win32.isAbsolute(resolvedOutputPath) && !node_path.default.posix.isAbsolute(resolvedOutputPath) ? node_path.default.win32 : node_path.default;
@@ -2344,8 +2344,8 @@ function setupWebpackWatchOutputIgnore(compiler) {
2344
2344
  }
2345
2345
  return { ignored: appendIgnoredPath(void 0, outputDir) };
2346
2346
  };
2347
- const compilerWatchOptions = appendOutputIgnoredPath(compiler.options.watchOptions);
2348
- if (compilerWatchOptions) compiler.options.watchOptions = compilerWatchOptions;
2347
+ const compilerWatchOptions = appendOutputIgnoredPath(compilerOptions.watchOptions);
2348
+ if (compilerWatchOptions) compilerOptions.watchOptions = compilerWatchOptions;
2349
2349
  const syncOutputIgnoredPath = () => {
2350
2350
  const outputPath = compiler.outputPath || compiler.options?.output?.path;
2351
2351
  const watchOptions = compiler.watching?.watchOptions;
@@ -2357,8 +2357,8 @@ function setupWebpackWatchOutputIgnore(compiler) {
2357
2357
  const watchOptions = compiler.watching?.watchOptions;
2358
2358
  if (watchOptions) appendOutputIgnoredPath(watchOptions, outputPath);
2359
2359
  else {
2360
- const compilerWatchOptions = appendOutputIgnoredPath(compiler.options.watchOptions, outputPath);
2361
- if (compilerWatchOptions) compiler.options.watchOptions = compilerWatchOptions;
2360
+ const compilerWatchOptions = appendOutputIgnoredPath(compilerOptions.watchOptions, outputPath);
2361
+ if (compilerWatchOptions) compilerOptions.watchOptions = compilerWatchOptions;
2362
2362
  }
2363
2363
  });
2364
2364
  }
package/dist/webpack.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_webpack = require("./webpack-BQNnpQPC.cjs");
2
+ const require_webpack = require("./webpack-R2Sbggiy.cjs");
3
3
  exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
4
4
  exports.weappTailwindcss = require_webpack.WeappTailwindcss;
5
5
  exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
package/dist/webpack.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-BnCSOUuu.js";
1
+ import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-D6jp1o3m.js";
2
2
  export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
@@ -1,6 +1,6 @@
1
- import type { TraverseOptions } from '@babel/traverse';
1
+ import type { TraverseOptions, Visitor } from '@babel/traverse';
2
2
  import type { JsTokenUpdater } from '../../../js/JsTokenUpdater.js';
3
3
  import type { ITemplateHandlerOptions } from '../../../types/index.js';
4
- export declare function createLegacyTraverseOptions(options: ITemplateHandlerOptions, jsTokenUpdater: JsTokenUpdater): TraverseOptions & {
4
+ export declare function createLegacyTraverseOptions(options: ITemplateHandlerOptions, jsTokenUpdater: JsTokenUpdater): TraverseOptions & Visitor & {
5
5
  noScope: true;
6
6
  };
@@ -1,3 +1,3 @@
1
1
  import type { ITemplateHandlerOptions } from '../../types/index.js';
2
2
  import type { AttributeMatcher } from '../custom-attributes.js';
3
- export declare function customTemplateHandler(rawSource: string, options: Required<ITemplateHandlerOptions>, cachedMatcher?: AttributeMatcher | undefined): Promise<string>;
3
+ export declare function customTemplateHandler(rawSource: string, options: ITemplateHandlerOptions, cachedMatcher?: AttributeMatcher | undefined): Promise<string>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
3
  "type": "module",
4
- "version": "5.5.5",
4
+ "version": "5.5.6",
5
5
  "description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -201,29 +201,26 @@
201
201
  }
202
202
  },
203
203
  "dependencies": {
204
- "@babel/parser": "^8.0.4",
205
- "@babel/traverse": "^8.0.4",
206
- "@babel/types": "^8.0.4",
207
- "@csstools/css-tokenizer": "^4.0.0",
204
+ "@babel/parser": "^8.0.5",
205
+ "@babel/traverse": "^8.0.5",
206
+ "@babel/types": "^8.0.5",
208
207
  "@tailwindcss-mangle/engine": "0.2.0",
209
208
  "@vue/compiler-dom": "^3.5.41",
210
209
  "@weapp-core/escape": "~8.0.0",
211
210
  "@weapp-tailwindcss/logger": "2.0.3",
212
- "@weapp-tailwindcss/postcss": "3.3.4",
211
+ "@weapp-tailwindcss/postcss": "3.3.5",
213
212
  "@weapp-tailwindcss/reset": "0.1.4",
214
213
  "@weapp-tailwindcss/shared": "2.0.3",
215
214
  "comment-json": "^5.0.0",
216
215
  "debug": "~4.4.3",
217
216
  "fast-glob": "^3.3.3",
218
217
  "htmlparser2": "^12.0.0",
219
- "lightningcss": "^1.33.0",
220
218
  "local-pkg": "^1.2.1",
221
219
  "lru-cache": "11.5.2",
222
- "magic-string": "^1.3.1",
220
+ "magic-string": "^1.4.1",
223
221
  "micromatch": "^4.0.8",
224
- "oxc-parser": "^0.149.0",
222
+ "oxc-parser": "^0.150.0",
225
223
  "oxc-walker": "^1.1.1",
226
- "postcss-scss": "^4.0.9",
227
224
  "semver": "~7.8.5",
228
225
  "tailwindcss-config": "2.0.4",
229
226
  "weapp-style-injector": "1.0.5",
@@ -231,6 +228,7 @@
231
228
  },
232
229
  "devDependencies": {
233
230
  "@mpxjs/webpack-plugin": "^2.11.1",
231
+ "vite": "^7.3.6",
234
232
  "webpack": "5.105.4"
235
233
  },
236
234
  "scripts": {
@@ -1,138 +0,0 @@
1
- let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
2
- //#region src/bundlers/shared/final-css-cleanup.ts
3
- function isCssWhitespace(code) {
4
- return code === 9 || code === 10 || code === 12 || code === 13 || code === 32;
5
- }
6
- function isCssWordChar(code) {
7
- return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95;
8
- }
9
- const EMPTY_CSS_BLOCK_RE = /\{(?:[\t\n\f\r ]|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/;
10
- function findCssPreludeStart(css, start, end) {
11
- let cursor = start;
12
- while (cursor < end) {
13
- while (cursor < end && isCssWhitespace(css.charCodeAt(cursor))) cursor++;
14
- if (css.charCodeAt(cursor) !== 47 || css.charCodeAt(cursor + 1) !== 42) return cursor;
15
- const commentEnd = css.indexOf("*/", cursor + 2);
16
- if (commentEnd < 0 || commentEnd + 2 > end) return end;
17
- cursor = commentEnd + 2;
18
- }
19
- return end;
20
- }
21
- function isKeyframesAtRule(css, start, end) {
22
- let cursor = start + 1;
23
- if (css.charCodeAt(cursor) === 45) {
24
- cursor++;
25
- const prefixStart = cursor;
26
- while (cursor < end && isCssWordChar(css.charCodeAt(cursor))) cursor++;
27
- if (cursor === prefixStart || css.charCodeAt(cursor) !== 45) return false;
28
- cursor++;
29
- }
30
- if (cursor + 9 > end || css.slice(cursor, cursor + 9).toLowerCase() !== "keyframes") return false;
31
- return !isCssWordChar(css.charCodeAt(cursor + 9));
32
- }
33
- function hasEmptyCssBlockCandidate(css) {
34
- if (!EMPTY_CSS_BLOCK_RE.test(css)) return false;
35
- const blocks = [];
36
- let parenthesisDepth = 0;
37
- let quote = 0;
38
- let squareBracketDepth = 0;
39
- let statementStart = 0;
40
- for (let index = 0; index < css.length; index++) {
41
- const code = css.charCodeAt(index);
42
- if (quote !== 0) {
43
- if (code === 92) index++;
44
- else if (code === quote) quote = 0;
45
- continue;
46
- }
47
- if (code === 34 || code === 39) {
48
- quote = code;
49
- if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
50
- continue;
51
- }
52
- if (code === 92) {
53
- if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
54
- index++;
55
- continue;
56
- }
57
- if (code === 47 && css.charCodeAt(index + 1) === 42) {
58
- const commentEnd = css.indexOf("*/", index + 2);
59
- if (commentEnd < 0) return false;
60
- index = commentEnd + 1;
61
- continue;
62
- }
63
- if (code === 40) {
64
- parenthesisDepth++;
65
- continue;
66
- }
67
- if (code === 41 && parenthesisDepth > 0) {
68
- parenthesisDepth--;
69
- continue;
70
- }
71
- if (code === 91) {
72
- squareBracketDepth++;
73
- continue;
74
- }
75
- if (code === 93 && squareBracketDepth > 0) {
76
- squareBracketDepth--;
77
- continue;
78
- }
79
- if (code === 123 && parenthesisDepth === 0 && squareBracketDepth === 0) {
80
- const preludeStart = findCssPreludeStart(css, statementStart, index);
81
- const isAtRule = css.charCodeAt(preludeStart) === 64;
82
- const isKeyframesContainer = isAtRule && isKeyframesAtRule(css, preludeStart, index);
83
- blocks.push({
84
- hasContent: false,
85
- isKeyframesContainer,
86
- isKeyframeStep: !isAtRule && blocks[blocks.length - 1]?.isKeyframesContainer === true
87
- });
88
- statementStart = index + 1;
89
- continue;
90
- }
91
- if (code === 125 && parenthesisDepth === 0 && squareBracketDepth === 0) {
92
- const block = blocks.pop();
93
- if (!block) continue;
94
- if (!block.hasContent && !block.isKeyframeStep) return true;
95
- if (blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
96
- statementStart = index + 1;
97
- continue;
98
- }
99
- if (code === 59 && parenthesisDepth === 0 && squareBracketDepth === 0) {
100
- statementStart = index + 1;
101
- continue;
102
- }
103
- if (!isCssWhitespace(code) && blocks.length > 0) blocks[blocks.length - 1].hasContent = true;
104
- }
105
- return false;
106
- }
107
- /**
108
- * 在小程序样式进入最终产物图时递归清理无语义的空 CSS 块。
109
- */
110
- function finalizeMiniProgramCssStructure(css) {
111
- const repaired = (0, _weapp_tailwindcss_postcss.repairTrailingUnclosedTailwindSourceMedia)(css);
112
- if (!hasEmptyCssBlockCandidate(repaired)) return repaired;
113
- try {
114
- const root = _weapp_tailwindcss_postcss.postcss.parse(repaired);
115
- let removed = 0;
116
- let passRemoved = 0;
117
- do {
118
- passRemoved = (0, _weapp_tailwindcss_postcss.removeEmptyRules)(root) + (0, _weapp_tailwindcss_postcss.removeEmptyAtRules)(root);
119
- removed += passRemoved;
120
- } while (passRemoved > 0);
121
- return removed > 0 ? root.toString() : repaired;
122
- } catch {
123
- return repaired;
124
- }
125
- }
126
- //#endregion
127
- Object.defineProperty(exports, "finalizeMiniProgramCssStructure", {
128
- enumerable: true,
129
- get: function() {
130
- return finalizeMiniProgramCssStructure;
131
- }
132
- });
133
- Object.defineProperty(exports, "hasEmptyCssBlockCandidate", {
134
- enumerable: true,
135
- get: function() {
136
- return hasEmptyCssBlockCandidate;
137
- }
138
- });
@@ -1,14 +0,0 @@
1
- export declare function parseCssImportSpecifier(params: string): {
2
- specifier: string;
3
- raw: string;
4
- quote: string | undefined;
5
- } | undefined;
6
- export declare function quoteCssImportSpecifier(file: string, quote?: string): string;
7
- export declare function isTailwindCssImport(params: string): boolean;
8
- export declare function parseImportSourceParam(params: string): {
9
- none: boolean;
10
- sourcePath: undefined;
11
- } | {
12
- none: boolean;
13
- sourcePath: string;
14
- } | undefined;
@@ -1,2 +0,0 @@
1
- export declare function parseUniAppXStyleSource(source: string): import("postcss").Root;
2
- export declare function isUniAppXStyleSourceEmpty(source: string): boolean;