weapp-tailwindcss 5.0.0-next.2 → 5.0.0-next.5

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 (95) hide show
  1. package/README.md +4 -5
  2. package/bin/weapp-tailwindcss.js +1 -21
  3. package/dist/bundlers/shared/generator-css.d.ts +5 -2
  4. package/dist/bundlers/vite/generate-bundle.d.ts +1 -0
  5. package/dist/bundlers/vite/index.d.ts +1 -1
  6. package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
  7. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +0 -1
  8. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
  9. package/dist/cli/context.d.ts +0 -3
  10. package/dist/cli/mount-options.d.ts +2 -0
  11. package/dist/cli.js +8 -2
  12. package/dist/cli.mjs +8 -2
  13. package/dist/constants.d.ts +1 -1
  14. package/dist/core.js +1 -1
  15. package/dist/core.mjs +1 -1
  16. package/dist/css-macro.d.ts +1 -0
  17. package/dist/defaults.js +5 -7
  18. package/dist/defaults.mjs +5 -7
  19. package/dist/generator/index.d.ts +1 -1
  20. package/dist/generator/options.d.ts +3 -4
  21. package/dist/{generator-mmhXzZnv.js → generator-9UEp8OoQ.js} +259 -21
  22. package/dist/{generator-Y-Ikv4Fu.mjs → generator-Dpp-5s8z.mjs} +260 -22
  23. package/dist/{generator-css-D3OdPRiS.js → generator-css-CGueCYbX.js} +182 -42
  24. package/dist/{generator-css-B5ejWUMv.mjs → generator-css-MyjZhF0z.mjs} +182 -42
  25. package/dist/generator.js +1 -1
  26. package/dist/generator.mjs +1 -1
  27. package/dist/gulp.js +17 -14
  28. package/dist/gulp.mjs +17 -14
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +4 -4
  31. package/dist/index.mjs +4 -4
  32. package/dist/js/index.d.ts +1 -0
  33. package/dist/js/literal-transform.d.ts +2 -0
  34. package/dist/{logger-BoVx1Dbt.mjs → logger-1gx9UllH.mjs} +21 -51
  35. package/dist/{logger-BZ45DZJT.js → logger-D9clu_3f.js} +21 -51
  36. package/dist/patcher-options-DnqazL9E.js +34 -0
  37. package/dist/patcher-options-GuOwX0-k.mjs +17 -0
  38. package/dist/postcss.d.ts +2 -2
  39. package/dist/postcss.js +37 -28
  40. package/dist/postcss.mjs +37 -28
  41. package/dist/presets.js +1 -1
  42. package/dist/presets.mjs +1 -1
  43. package/dist/{recorder-zsgatmkB.mjs → recorder-BIW3Kuke.mjs} +5 -12
  44. package/dist/{recorder-gYSNLfOP.js → recorder-D4BKt75Q.js} +5 -12
  45. package/dist/reset.d.ts +1 -0
  46. package/dist/{css-imports-BbrbluP9.js → run-tasks-Cq5A5nVD.js} +6 -55
  47. package/dist/{css-imports-CSdPq_Sc.mjs → run-tasks-DUVrDJGl.mjs} +5 -42
  48. package/dist/tailwindcss/miniprogram.d.ts +5 -1
  49. package/dist/tailwindcss/patcher-options.d.ts +3 -51
  50. package/dist/tailwindcss/patcher.d.ts +1 -2
  51. package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
  52. package/dist/tailwindcss/v4/patcher.d.ts +1 -0
  53. package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
  54. package/dist/tailwindcss/version.d.ts +4 -0
  55. package/dist/typedoc.export.d.ts +0 -2
  56. package/dist/types/index.d.ts +1 -3
  57. package/dist/types/shared.d.ts +3 -0
  58. package/dist/types/user-defined-options/general.d.ts +0 -2
  59. package/dist/types/user-defined-options/important.d.ts +3 -3
  60. package/dist/utils/disabled.d.ts +2 -3
  61. package/dist/version-CWBxRFPB.js +56 -0
  62. package/dist/version-WNz3MwRv.mjs +49 -0
  63. package/dist/{vite-BC9U7ahn.js → vite-BkMGwDeH.js} +106 -39
  64. package/dist/{vite-CrlzCNqz.mjs → vite-fDM-UQpR.mjs} +89 -22
  65. package/dist/vite.d.ts +1 -2
  66. package/dist/vite.js +3 -4
  67. package/dist/vite.mjs +2 -2
  68. package/dist/weapp-tw-css-import-rewrite-loader.js +1 -1
  69. package/dist/{webpack-DD7A6V0u.js → webpack-CICGEKT9.js} +225 -43
  70. package/dist/{webpack-Bu6M-Hbw.mjs → webpack-D2Wdk28V.mjs} +214 -27
  71. package/dist/webpack.js +1 -1
  72. package/dist/webpack.mjs +1 -1
  73. package/package.json +21 -30
  74. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
  75. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
  76. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
  77. package/dist/experimental/index.d.ts +0 -2
  78. package/dist/experimental/oxc/ast-utils.d.ts +0 -30
  79. package/dist/experimental/oxc/index.d.ts +0 -2
  80. package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
  81. package/dist/experimental/shared/cache.d.ts +0 -3
  82. package/dist/experimental/shared/transform.d.ts +0 -3
  83. package/dist/experimental/shared.d.ts +0 -8
  84. package/dist/experimental/swc/ast-utils.d.ts +0 -30
  85. package/dist/experimental/swc/index.d.ts +0 -2
  86. package/dist/experimental/swc/module-specifiers.d.ts +0 -2
  87. package/dist/loader-anchors-CNkWT8hx.js +0 -273
  88. package/dist/loader-anchors-TrU7EUr7.mjs +0 -205
  89. package/dist/patcher-options-6gJN2EXy.js +0 -115
  90. package/dist/patcher-options-DQfR5xxT.mjs +0 -92
  91. package/dist/types/disabled-options.d.ts +0 -4
  92. package/dist/webpack4.d.ts +0 -4
  93. package/dist/webpack4.js +0 -387
  94. package/dist/webpack4.mjs +0 -379
  95. package/scripts/postinstall.mjs +0 -59
@@ -1,5 +1,5 @@
1
- import { a as resolveTailwindV4Source, c as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV3SourceOptionsFromPatcher, i as normalizeWeappTailwindcssGeneratorOptions, m as resolveTailwindV3SourceFromPatcher, p as resolveTailwindV3Source, s as resolveTailwindV4SourceFromPatcher, t as createWeappTailwindcssGenerator, v as removeUnsupportedCascadeLayers } from "./generator-Y-Ikv4Fu.mjs";
2
- import { l as replaceWxml } from "./recorder-zsgatmkB.mjs";
1
+ import { a as resolveTailwindV4Source, c as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV3SourceOptionsFromPatcher, i as normalizeWeappTailwindcssGeneratorOptions, m as resolveTailwindV3SourceFromPatcher, p as resolveTailwindV3Source, s as resolveTailwindV4SourceFromPatcher, t as createWeappTailwindcssGenerator, v as removeUnsupportedCascadeLayers } from "./generator-Dpp-5s8z.mjs";
2
+ import { l as replaceWxml } from "./recorder-BIW3Kuke.mjs";
3
3
  import postcss from "postcss";
4
4
  import path from "node:path";
5
5
  import process from "node:process";
@@ -162,7 +162,7 @@ function removeUnsupportedMiniProgramAtRules(css) {
162
162
  if (MINI_PROGRAM_UNSUPPORTED_AT_RULES.has(atRule.name)) atRule.remove();
163
163
  });
164
164
  root.walkAtRules((atRule) => {
165
- if (!atRule.nodes || atRule.nodes.length === 0) atRule.remove();
165
+ if (atRule.nodes && atRule.nodes.length === 0) atRule.remove();
166
166
  });
167
167
  return root.toString();
168
168
  } catch {
@@ -563,6 +563,10 @@ function inheritLegacyUnitConvertedDeclarations(css, legacyCss) {
563
563
  }
564
564
  }
565
565
  function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOptions) {
566
+ const tailwindV3StyleOptions = cssHandlerOptions.majorVersion === 3 ? {
567
+ cssPreflight: opts.cssPreflight,
568
+ cssPreflightRange: opts.cssPreflightRange
569
+ } : {};
566
570
  return {
567
571
  cssChildCombinatorReplaceValue: opts.cssChildCombinatorReplaceValue,
568
572
  cssSelectorReplacement: opts.cssSelectorReplacement,
@@ -579,6 +583,7 @@ function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOpt
579
583
  uniAppXCssTarget: opts.uniAppXCssTarget,
580
584
  uniAppXUnsupported: opts.uniAppXUnsupported,
581
585
  ...cssHandlerOptions,
586
+ ...tailwindV3StyleOptions,
582
587
  ...generatorStyleOptions
583
588
  };
584
589
  }
@@ -588,6 +593,9 @@ function parseImportRequest(params) {
588
593
  function parseConfigRequest(params) {
589
594
  return /^(["'])(.+)\1\s*;?$/.exec(params.trim())?.[2];
590
595
  }
596
+ function isPackageJsonImportRequest(request) {
597
+ return typeof request === "string" && request.startsWith("#");
598
+ }
591
599
  function resolvePostcssFromOption(cssHandlerOptions) {
592
600
  const from = cssHandlerOptions.postcssOptions?.options?.from;
593
601
  return typeof from === "string" && from.length > 0 ? from : void 0;
@@ -605,11 +613,13 @@ function isTailwindImportAtRule(node) {
605
613
  function isTailwindSourceDirective(node) {
606
614
  if (node.type !== "atrule") return false;
607
615
  if (isTailwindImportAtRule(node)) return true;
616
+ if (node.name === "import" && isPackageJsonImportRequest(parseImportRequest(node.params))) return true;
608
617
  return TAILWIND_REMOVABLE_SOURCE_DIRECTIVE_NAMES.has(node.name);
609
618
  }
610
619
  function isTailwindGenerationDirective(node) {
611
620
  if (node.type !== "atrule") return false;
612
- return isTailwindImportAtRule(node) || node.name === "layer" || node.name === "config";
621
+ const request = node.name === "import" ? parseImportRequest(node.params) : node.name === "config" || node.name === "plugin" || node.name === "reference" ? parseConfigRequest(node.params) : void 0;
622
+ return isTailwindImportAtRule(node) || isPackageJsonImportRequest(request) || node.name === "apply" || node.name === "layer" || node.name === "config" || node.name === "source";
613
623
  }
614
624
  function removeTailwindSourceDirectives(rawSource) {
615
625
  try {
@@ -657,7 +667,7 @@ function resolveCssEntrySource(rawSource, base, options = {}) {
657
667
  const configPath = parseConfigRequest(node.params);
658
668
  if (configPath && !config) {
659
669
  configRequest = configPath;
660
- config = path.isAbsolute(configPath) ? configPath : path.resolve(base, configPath);
670
+ config = isPackageJsonImportRequest(configPath) ? void 0 : path.isAbsolute(configPath) ? configPath : path.resolve(base, configPath);
661
671
  }
662
672
  if (removeConfig) {
663
673
  node.remove();
@@ -696,6 +706,20 @@ function resolveExistingConfigPath(config, configRequest, file, sourceOptions) {
696
706
  }
697
707
  return sourceOptions.config;
698
708
  }
709
+ function quoteCssString(value) {
710
+ return value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
711
+ }
712
+ function toCssPath(value) {
713
+ return value.replaceAll("\\", "/");
714
+ }
715
+ function prependConfigDirective(css, config) {
716
+ if (!config || /@config\s+/.test(css)) return css;
717
+ return `@config "${quoteCssString(toCssPath(config))}";\n${css}`;
718
+ }
719
+ function normalizeConfigDirective(css, config) {
720
+ if (!config || !/@config\s+/.test(css)) return css;
721
+ return css.replace(/@config\s+(["'])(.+?)\1\s*;?/, `@config "${quoteCssString(toCssPath(config))}";`);
722
+ }
699
723
  function stripStyleExtension(file) {
700
724
  return file.replace(/[?#].*$/, "").replace(/\.(?:wx|ac|jx|tt|q|c|ty)?ss$/i, "");
701
725
  }
@@ -737,6 +761,11 @@ function createSourceStylePathCandidates(file, sourceOptions) {
737
761
  }
738
762
  return [...candidates];
739
763
  }
764
+ function canResolveSourceSideCssEntry(file, cssHandlerOptions) {
765
+ const from = resolvePostcssFromOption(cssHandlerOptions);
766
+ if (!from || !path.isAbsolute(from)) return path.isAbsolute(file);
767
+ return true;
768
+ }
740
769
  function extractStyleDirectiveSources(source) {
741
770
  const styleSources = [];
742
771
  SFC_STYLE_BLOCK_RE.lastIndex = 0;
@@ -766,6 +795,34 @@ function resolveSourceSideCssEntrySource(file, sourceOptions, resolveOptions = {
766
795
  }
767
796
  }
768
797
  }
798
+ function normalizeCssSourceForCompare(css) {
799
+ return stripGeneratorPlaceholderMarkers(stripTailwindBanners(css)).trim();
800
+ }
801
+ function getOutputFileStem(file) {
802
+ const normalized = file.replace(/[?#].*$/, "");
803
+ return path.basename(normalized, path.extname(normalized));
804
+ }
805
+ function resolveMatchingTailwindV4CssEntry(rawSource, file, sourceOptions) {
806
+ const cssEntries = sourceOptions.cssEntries;
807
+ if (!cssEntries?.length) return;
808
+ const normalizedRawSource = normalizeCssSourceForCompare(rawSource);
809
+ const outputStem = getOutputFileStem(file);
810
+ const matchingEntry = cssEntries.find((cssEntry) => {
811
+ if (!existsSync(cssEntry)) return false;
812
+ try {
813
+ if (normalizeCssSourceForCompare(readFileSync(cssEntry, "utf8")) === normalizedRawSource) return true;
814
+ return outputStem.length > 0 && getOutputFileStem(cssEntry) === outputStem;
815
+ } catch {
816
+ return false;
817
+ }
818
+ });
819
+ if (!matchingEntry) return;
820
+ return resolveTailwindV4Source({
821
+ ...sourceOptions,
822
+ css: void 0,
823
+ cssEntries: [matchingEntry]
824
+ });
825
+ }
769
826
  function tryResolveTailwindV4SourceOptions(runtimeState) {
770
827
  try {
771
828
  return resolveTailwindV4SourceOptionsFromPatcher(runtimeState.twPatcher);
@@ -773,16 +830,20 @@ function tryResolveTailwindV4SourceOptions(runtimeState) {
773
830
  return;
774
831
  }
775
832
  }
776
- async function resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions) {
833
+ async function resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions) {
777
834
  const cssEntrySource = resolveCssEntrySource(rawSource, resolveCssSourceBase(file, cssHandlerOptions), { removeConfig: majorVersion === 3 });
778
835
  if (majorVersion === 3) {
779
836
  const sourceOptions = resolveTailwindV3SourceOptionsFromPatcher(runtimeState.twPatcher);
780
- const sourceSideEntrySource = resolveSourceSideCssEntrySource(file, sourceOptions, { removeConfig: true });
837
+ const mergedSourceOptions = {
838
+ ...sourceOptions,
839
+ config: generatorOptions?.config ?? sourceOptions.config
840
+ };
841
+ const sourceSideEntrySource = canResolveSourceSideCssEntry(file, cssHandlerOptions) ? resolveSourceSideCssEntrySource(file, mergedSourceOptions, { removeConfig: true }) : void 0;
781
842
  const resolvedEntrySource = cssEntrySource ?? sourceSideEntrySource;
782
- if (!resolvedEntrySource) return resolveTailwindV3SourceFromPatcher(runtimeState.twPatcher);
783
- const config = resolveExistingConfigPath(resolvedEntrySource.config, resolvedEntrySource.configRequest, file, sourceOptions);
843
+ if (!resolvedEntrySource) return generatorOptions?.config ? resolveTailwindV3Source(mergedSourceOptions) : resolveTailwindV3SourceFromPatcher(runtimeState.twPatcher);
844
+ const config = resolveExistingConfigPath(resolvedEntrySource.config, resolvedEntrySource.configRequest, file, mergedSourceOptions);
784
845
  return resolveTailwindV3Source({
785
- ...sourceOptions,
846
+ ...mergedSourceOptions,
786
847
  base: resolvedEntrySource.base,
787
848
  css: resolvedEntrySource.css,
788
849
  ...config ? { config } : {}
@@ -790,29 +851,46 @@ async function resolveGeneratorSource(majorVersion, runtimeState, rawSource, fil
790
851
  }
791
852
  const sourceOptions = tryResolveTailwindV4SourceOptions(runtimeState);
792
853
  const shouldPreferSourceSideEntry = shouldResolveSourceSideCssEntry(rawSource) || Boolean(cssEntrySource?.css.includes("weapp-tailwindcss generator-placeholder"));
793
- const resolvedEntrySource = (sourceOptions && shouldPreferSourceSideEntry ? resolveSourceSideCssEntrySource(file, sourceOptions, { removeConfig: false }) : void 0) ?? cssEntrySource;
794
- if (!resolvedEntrySource) return resolveTailwindV4SourceFromPatcher(runtimeState.twPatcher);
854
+ const sourceSideEntrySource = sourceOptions && shouldPreferSourceSideEntry ? resolveSourceSideCssEntrySource(file, sourceOptions, { removeConfig: false }) : void 0;
855
+ const matchedCssEntrySource = sourceOptions && cssEntrySource ? await resolveMatchingTailwindV4CssEntry(rawSource, file, sourceOptions) : void 0;
856
+ if (matchedCssEntrySource) return generatorOptions?.config ? {
857
+ ...matchedCssEntrySource,
858
+ css: prependConfigDirective(matchedCssEntrySource.css, generatorOptions.config)
859
+ } : matchedCssEntrySource;
860
+ const resolvedEntrySource = sourceSideEntrySource ?? cssEntrySource;
861
+ if (!resolvedEntrySource) {
862
+ const source = await resolveTailwindV4SourceFromPatcher(runtimeState.twPatcher);
863
+ return generatorOptions?.config ? {
864
+ ...source,
865
+ css: prependConfigDirective(source.css, generatorOptions.config)
866
+ } : source;
867
+ }
868
+ const resolvedSourceOptions = sourceOptions ?? {};
869
+ const config = resolveExistingConfigPath(resolvedEntrySource.config, resolvedEntrySource.configRequest, file, resolvedSourceOptions);
795
870
  return resolveTailwindV4Source({
796
- ...sourceOptions ?? {},
871
+ ...resolvedSourceOptions,
797
872
  base: resolvedEntrySource.base,
798
- css: resolvedEntrySource.css
873
+ css: normalizeConfigDirective(prependConfigDirective(resolvedEntrySource.css, generatorOptions?.config), config)
799
874
  });
800
875
  }
801
- async function resolveGeneratorSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions) {
876
+ async function resolveGeneratorSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions) {
802
877
  const cssEntrySource = resolveCssEntrySource(rawSource, resolveCssSourceBase(file, cssHandlerOptions), { removeConfig: majorVersion === 3 });
803
- if (majorVersion !== 4 || cssEntrySource && !cssHandlerOptions.isMainChunk) return [await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions)];
878
+ if (majorVersion !== 4 || cssEntrySource && !cssHandlerOptions.isMainChunk) return [await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions)];
804
879
  let sourceOptions;
805
880
  try {
806
881
  sourceOptions = resolveTailwindV4SourceOptionsFromPatcher(runtimeState.twPatcher);
807
882
  } catch {
808
- return [await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions)];
883
+ return [await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions)];
809
884
  }
810
- if (!sourceOptions.cssEntries || sourceOptions.cssEntries.length <= 1) return [await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions)];
885
+ if (!sourceOptions.cssEntries || sourceOptions.cssEntries.length <= 1) return [await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions)];
811
886
  return await Promise.all(sourceOptions.cssEntries.map((cssEntry) => resolveTailwindV4Source({
812
887
  ...sourceOptions,
813
888
  css: void 0,
814
889
  cssEntries: [cssEntry]
815
- })));
890
+ }).then((source) => generatorOptions?.config ? {
891
+ ...source,
892
+ css: prependConfigDirective(source.css, generatorOptions.config)
893
+ } : source)));
816
894
  }
817
895
  function isLocalImportRequest(request) {
818
896
  return request.length > 0 && !request.startsWith("tailwindcss") && !request.startsWith("weapp-tailwindcss") && !request.startsWith("data:") && !REMOTE_IMPORT_RE.test(request);
@@ -833,8 +911,62 @@ function isPureLocalCssImportWrapper(css) {
833
911
  }
834
912
  return hasImport;
835
913
  }
914
+ function cleanLocalCssImportWrapperTailwindDirectives(css) {
915
+ let hasLocalImport = false;
916
+ let hasTailwindDirective = false;
917
+ try {
918
+ const root = postcss.parse(css);
919
+ for (const node of root.nodes) {
920
+ if (node.type === "comment") continue;
921
+ if (node.type === "atrule" && node.name === "import") {
922
+ const request = parseImportRequest(node.params);
923
+ if (!request || !isLocalImportRequest(request)) return;
924
+ hasLocalImport = true;
925
+ continue;
926
+ }
927
+ if (node.type === "atrule" && node.name === "source") {
928
+ hasTailwindDirective = true;
929
+ continue;
930
+ }
931
+ return;
932
+ }
933
+ } catch {
934
+ return;
935
+ }
936
+ return hasLocalImport && hasTailwindDirective ? prefixLocalCssImportsWithWebpackIgnore(removeTailwindSourceDirectives(css)) : void 0;
937
+ }
938
+ function prefixLocalCssImportsWithWebpackIgnore(css) {
939
+ try {
940
+ const root = postcss.parse(css);
941
+ root.walkAtRules("import", (atRule) => {
942
+ const request = parseImportRequest(atRule.params);
943
+ if (request && isLocalImportRequest(request)) atRule.raws.before = `${atRule.raws.before ?? ""}/* webpackIgnore: true */\n`;
944
+ });
945
+ return root.toString();
946
+ } catch {
947
+ return css;
948
+ }
949
+ }
836
950
  function resolveLegacyCompatCssSource(rawSource) {
837
- return removeUnsupportedMiniProgramAtRules(removeTailwindSourceDirectives(stripTailwindBanners(rawSource)));
951
+ return removeUnsupportedMiniProgramAtRules(removeTailwindApplyRules(removeTailwindSourceDirectives(stripTailwindBanners(rawSource))));
952
+ }
953
+ function removeTailwindApplyRules(rawSource) {
954
+ try {
955
+ const root = postcss.parse(rawSource);
956
+ let removed = false;
957
+ root.walkAtRules("apply", (rule) => {
958
+ const parent = rule.parent;
959
+ if (parent?.type === "rule") parent.remove();
960
+ else rule.remove();
961
+ removed = true;
962
+ });
963
+ root.walkAtRules((rule) => {
964
+ if (rule.nodes && rule.nodes.length === 0) rule.remove();
965
+ });
966
+ return removed ? root.toString() : rawSource;
967
+ } catch {
968
+ return rawSource;
969
+ }
838
970
  }
839
971
  function hasContainerConfigToken(rawSource) {
840
972
  return rawSource.includes("@config") && /\bcontainer\b/.test(rawSource);
@@ -941,7 +1073,7 @@ function removeGeneratedSelectorCompatCss(css, generatedCss) {
941
1073
  }
942
1074
  });
943
1075
  root.walkAtRules((atRule) => {
944
- if (!atRule.nodes || atRule.nodes.length === 0) atRule.remove();
1076
+ if (atRule.nodes && atRule.nodes.length === 0) atRule.remove();
945
1077
  });
946
1078
  return removed ? root.toString() : css;
947
1079
  } catch {
@@ -1014,21 +1146,28 @@ async function generateCssByGenerator(options) {
1014
1146
  const { opts, runtimeState, runtime, rawSource, file, cssHandlerOptions, cssUserHandlerOptions, styleHandler, debug } = options;
1015
1147
  const generatorOptions = normalizeWeappTailwindcssGeneratorOptions(opts.generator);
1016
1148
  const majorVersion = runtimeState.twPatcher.majorVersion;
1149
+ const cleanedLocalImportWrapper = cleanLocalCssImportWrapperTailwindDirectives(rawSource);
1150
+ if (cleanedLocalImportWrapper !== void 0) return {
1151
+ css: generatorOptions.target === "weapp" ? removeUnsupportedMiniProgramAtRules(cleanedLocalImportWrapper) : cleanedLocalImportWrapper,
1152
+ target: generatorOptions.target,
1153
+ source: "generator",
1154
+ dependencies: []
1155
+ };
1017
1156
  if (isPureLocalCssImportWrapper(rawSource)) return;
1018
1157
  const hasGeneratedCss = hasTailwindGeneratedCss(rawSource);
1019
1158
  const hasSourceDirectives = hasTailwindSourceDirectives(rawSource);
1020
1159
  const hasGeneratedMarkers = hasTailwindGeneratedCssMarkers(rawSource);
1021
- const shouldForceGenerateCurrentCss = hasGeneratedCss || hasGeneratedMarkers || hasSourceDirectives || cssHandlerOptions.isMainChunk;
1022
- if (generatorOptions.mode === "off" || !SUPPORTED_GENERATOR_MAJOR_VERSIONS.has(majorVersion ?? 0) || generatorOptions.mode === "force" && (!shouldForceGenerateCurrentCss || majorVersion === 3 && !hasSourceDirectives && !hasGeneratedCss && !hasGeneratedMarkers) || generatorOptions.mode !== "force" && majorVersion !== 3 && !hasGeneratedCss || !cssHandlerOptions.isMainChunk && majorVersion !== 3 && generatorOptions.mode !== "force" && !hasGeneratedCss) return;
1160
+ const shouldGenerateCurrentCss = hasGeneratedCss || hasGeneratedMarkers || hasSourceDirectives || cssHandlerOptions.isMainChunk;
1161
+ if (!SUPPORTED_GENERATOR_MAJOR_VERSIONS.has(majorVersion ?? 0) || !shouldGenerateCurrentCss || majorVersion === 3 && !hasSourceDirectives && !hasGeneratedCss && !hasGeneratedMarkers) return;
1023
1162
  try {
1024
1163
  await runtimeState.patchPromise;
1025
- const sources = await resolveGeneratorSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions);
1164
+ const sources = await resolveGeneratorSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions);
1026
1165
  const generatorStyleOptions = resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorOptions.styleOptions);
1027
1166
  const configuredContainerCompat = hasConfiguredContainerCompatSources(sources);
1028
1167
  const generatedResults = await Promise.all(sources.map(async (source) => {
1029
1168
  return createWeappTailwindcssGenerator(source).generate({
1030
1169
  candidates: runtime,
1031
- scanSources: false,
1170
+ scanSources: majorVersion === 4,
1032
1171
  styleOptions: generatorStyleOptions,
1033
1172
  tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
1034
1173
  target: generatorOptions.target
@@ -1056,7 +1195,8 @@ async function generateCssByGenerator(options) {
1056
1195
  if (extraSource.trim().length === 0) return {
1057
1196
  css: finalizeMiniProgramGeneratorCss(css, generated.target),
1058
1197
  target: generated.target,
1059
- source: "generator"
1198
+ source: "generator",
1199
+ dependencies: generated.dependencies
1060
1200
  };
1061
1201
  if (generated.target === "weapp") {
1062
1202
  const { css: userCss } = await styleHandler(extraSource, {
@@ -1067,31 +1207,31 @@ async function generateCssByGenerator(options) {
1067
1207
  } else css = createCssAppend(css, extraSource);
1068
1208
  }
1069
1209
  }
1070
- if (generated.target === "weapp" && generatorOptions.mode === "force") {
1210
+ if (generated.target === "weapp") {
1071
1211
  css = await appendLegacyCompatCss(css, rawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
1072
1212
  css = await appendLegacyContainerCompatCss(css, rawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
1073
1213
  }
1074
1214
  return {
1075
1215
  css: finalizeMiniProgramGeneratorCss(css, generated.target),
1076
1216
  target: generated.target,
1077
- source: "generator"
1078
- };
1079
- }
1080
- if (generatorOptions.mode === "force") {
1081
- debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
1082
- let css = stripTailwindBanner(generated.css);
1083
- if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, rawSource);
1084
- css = await appendLegacyCompatCss(css, rawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
1085
- css = await appendLegacyContainerCompatCss(css, rawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
1086
- return {
1087
- css: finalizeMiniProgramGeneratorCss(css, generated.target),
1088
- target: generated.target,
1089
- source: "generator-forced"
1217
+ source: "generator",
1218
+ dependencies: generated.dependencies
1090
1219
  };
1091
1220
  }
1221
+ debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
1222
+ let css = stripTailwindBanner(generated.css);
1223
+ if (generated.target === "weapp") css = inheritLegacyUnitConvertedDeclarations(css, rawSource);
1224
+ css = await appendLegacyCompatCss(css, rawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
1225
+ css = await appendLegacyContainerCompatCss(css, rawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
1226
+ return {
1227
+ css: finalizeMiniProgramGeneratorCss(css, generated.target),
1228
+ target: generated.target,
1229
+ source: "generator",
1230
+ dependencies: generated.dependencies
1231
+ };
1092
1232
  } catch (error) {
1093
- if (generatorOptions.mode === "force") throw error;
1094
- debug("tailwind direct css generation failed, fallback to styleHandler: %s %O", file, error);
1233
+ debug("tailwind direct css generation failed: %s %O", file, error);
1234
+ throw error;
1095
1235
  }
1096
1236
  }
1097
1237
  //#endregion
package/dist/generator.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("./chunk-8l464Juk.js");
3
- const require_generator = require("./generator-mmhXzZnv.js");
3
+ const require_generator = require("./generator-9UEp8OoQ.js");
4
4
  let tailwindcss_patch = require("tailwindcss-patch");
5
5
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
6
6
  exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
@@ -1,2 +1,2 @@
1
- import { _ as transformTailwindV3CssToWeapp, a as resolveTailwindV4Source, c as resolveTailwindV4SourceOptionsFromPatcher, g as transformTailwindV3CssByTarget, h as resolveTailwindV3SourceOptionsFromPatcher, i as normalizeWeappTailwindcssGeneratorOptions, l as transformTailwindV4CssByTarget, m as resolveTailwindV3SourceFromPatcher, n as createWeappTailwindcssGeneratorFromPatcher, o as resolveTailwindV4SourceFromPatchOptions, p as resolveTailwindV3Source, r as resolveTailwindSourceFromPatcher, s as resolveTailwindV4SourceFromPatcher, t as createWeappTailwindcssGenerator, u as transformTailwindV4CssToWeapp } from "./generator-Y-Ikv4Fu.mjs";
1
+ import { _ as transformTailwindV3CssToWeapp, a as resolveTailwindV4Source, c as resolveTailwindV4SourceOptionsFromPatcher, g as transformTailwindV3CssByTarget, h as resolveTailwindV3SourceOptionsFromPatcher, i as normalizeWeappTailwindcssGeneratorOptions, l as transformTailwindV4CssByTarget, m as resolveTailwindV3SourceFromPatcher, n as createWeappTailwindcssGeneratorFromPatcher, o as resolveTailwindV4SourceFromPatchOptions, p as resolveTailwindV3Source, r as resolveTailwindSourceFromPatcher, s as resolveTailwindV4SourceFromPatcher, t as createWeappTailwindcssGenerator, u as transformTailwindV4CssToWeapp } from "./generator-Dpp-5s8z.mjs";
2
2
  export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
package/dist/gulp.js CHANGED
@@ -1,7 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-8l464Juk.js");
3
- const require_recorder = require("./recorder-gYSNLfOP.js");
4
- const require_generator_css = require("./generator-css-D3OdPRiS.js");
3
+ const require_recorder = require("./recorder-D4BKt75Q.js");
4
+ const require_logger = require("./logger-D9clu_3f.js");
5
+ const require_generator_css = require("./generator-css-CGueCYbX.js");
5
6
  let node_path = require("node:path");
6
7
  node_path = require_chunk.__toESM(node_path);
7
8
  let node_process = require("node:process");
@@ -21,7 +22,6 @@ const Transform = node_stream.default.Transform;
21
22
  */
22
23
  function createPlugins(options = {}) {
23
24
  const opts = require_recorder.getCompilerContext(options);
24
- const hasExplicitGeneratorOptions = options.generator !== void 0;
25
25
  const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
26
26
  const patchRecorderState = require_recorder.setupPatchRecorder(initialTwPatcher, opts.tailwindcssBasedir, {
27
27
  source: "runtime",
@@ -47,9 +47,6 @@ function createPlugins(options = {}) {
47
47
  ".jsx"
48
48
  ];
49
49
  let runtimeSetInitialized = false;
50
- async function refreshRuntimeState(force) {
51
- await require_recorder.refreshTailwindRuntimeState(runtimeState, force);
52
- }
53
50
  async function refreshRuntimeSet(force = false) {
54
51
  if (!force && runtimeSetInitialized) return runtimeSet;
55
52
  runtimeSet = await require_recorder.ensureRuntimeClassSet(runtimeState, {
@@ -61,6 +58,13 @@ function createPlugins(options = {}) {
61
58
  runtimeSetInitialized = true;
62
59
  return runtimeSet;
63
60
  }
61
+ function createRuntimeSetHash(rawSource, nextRuntimeSet) {
62
+ return cache.computeHash([
63
+ rawSource,
64
+ require_logger.getRuntimeClassSetSignature(runtimeState.twPatcher),
65
+ [...nextRuntimeSet].sort().join("\n")
66
+ ].join("\n\n"));
67
+ }
64
68
  function resolveWithExtensions(base) {
65
69
  for (const ext of MODULE_EXTENSIONS) {
66
70
  const candidate = `${base}${ext}`;
@@ -167,13 +171,12 @@ function createPlugins(options = {}) {
167
171
  }
168
172
  const transformWxss = (options = {}) => createVinylTransform(async (file) => {
169
173
  if (!file.contents) return;
170
- await refreshRuntimeState(true);
171
- await runtimeState.patchPromise;
172
174
  const rawSource = file.contents.toString();
175
+ const nextRuntimeSet = await refreshRuntimeSet(true);
173
176
  await require_generator_css.processCachedTask({
174
177
  cache,
175
178
  cacheKey: file.path,
176
- rawSource,
179
+ hash: createRuntimeSetHash(rawSource, nextRuntimeSet),
177
180
  applyResult(source) {
178
181
  file.contents = node_buffer.Buffer.from(source);
179
182
  },
@@ -183,17 +186,17 @@ function createPlugins(options = {}) {
183
186
  async transform() {
184
187
  await runtimeState.patchPromise;
185
188
  const cssHandlerOptions = resolveWxssFileHandlerOptions(file, options);
186
- const css = (hasExplicitGeneratorOptions ? await require_generator_css.generateCssByGenerator({
189
+ const css = (await require_generator_css.generateCssByGenerator({
187
190
  opts,
188
191
  runtimeState,
189
- runtime: await refreshRuntimeSet(false),
192
+ runtime: nextRuntimeSet,
190
193
  rawSource,
191
194
  file: file.path,
192
195
  cssHandlerOptions,
193
196
  cssUserHandlerOptions: resolveWxssUserHandlerOptions(options),
194
197
  styleHandler,
195
198
  debug
196
- }) : void 0)?.css ?? (await styleHandler(rawSource, cssHandlerOptions)).css;
199
+ }))?.css ?? (await styleHandler(rawSource, cssHandlerOptions)).css;
197
200
  debug("css handle: %s", file.path);
198
201
  return { result: css };
199
202
  }
@@ -201,7 +204,7 @@ function createPlugins(options = {}) {
201
204
  });
202
205
  const transformJs = (options = {}) => createVinylTransform(async (file) => {
203
206
  if (!file.contents) return;
204
- await refreshRuntimeSet(false);
207
+ await refreshRuntimeSet(true);
205
208
  await runtimeState.patchPromise;
206
209
  const filename = node_path.default.resolve(file.path);
207
210
  const moduleGraph = resolveModuleGraphOptions(options.moduleGraph);
@@ -238,7 +241,7 @@ function createPlugins(options = {}) {
238
241
  });
239
242
  const transformWxml = (options = {}) => createVinylTransform(async (file) => {
240
243
  if (!file.contents) return;
241
- await refreshRuntimeSet(false);
244
+ await refreshRuntimeSet(true);
242
245
  await runtimeState.patchPromise;
243
246
  const rawSource = file.contents.toString();
244
247
  await require_generator_css.processCachedTask({
package/dist/gulp.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { _ as refreshTailwindRuntimeState, g as ensureRuntimeClassSet, n as shouldSkipJsTransform, r as getCompilerContext, t as setupPatchRecorder, v as createDebug } from "./recorder-zsgatmkB.mjs";
2
- import { i as processCachedTask, t as generateCssByGenerator } from "./generator-css-B5ejWUMv.mjs";
1
+ import { g as ensureRuntimeClassSet, n as shouldSkipJsTransform, r as getCompilerContext, t as setupPatchRecorder, v as createDebug } from "./recorder-BIW3Kuke.mjs";
2
+ import { d as getRuntimeClassSetSignature } from "./logger-1gx9UllH.mjs";
3
+ import { i as processCachedTask, t as generateCssByGenerator } from "./generator-css-MyjZhF0z.mjs";
3
4
  import path from "node:path";
4
5
  import process from "node:process";
5
6
  import { Buffer } from "node:buffer";
@@ -15,7 +16,6 @@ const Transform = stream.Transform;
15
16
  */
16
17
  function createPlugins(options = {}) {
17
18
  const opts = getCompilerContext(options);
18
- const hasExplicitGeneratorOptions = options.generator !== void 0;
19
19
  const { templateHandler, styleHandler, jsHandler, cache, twPatcher: initialTwPatcher, refreshTailwindcssPatcher } = opts;
20
20
  const patchRecorderState = setupPatchRecorder(initialTwPatcher, opts.tailwindcssBasedir, {
21
21
  source: "runtime",
@@ -41,9 +41,6 @@ function createPlugins(options = {}) {
41
41
  ".jsx"
42
42
  ];
43
43
  let runtimeSetInitialized = false;
44
- async function refreshRuntimeState(force) {
45
- await refreshTailwindRuntimeState(runtimeState, force);
46
- }
47
44
  async function refreshRuntimeSet(force = false) {
48
45
  if (!force && runtimeSetInitialized) return runtimeSet;
49
46
  runtimeSet = await ensureRuntimeClassSet(runtimeState, {
@@ -55,6 +52,13 @@ function createPlugins(options = {}) {
55
52
  runtimeSetInitialized = true;
56
53
  return runtimeSet;
57
54
  }
55
+ function createRuntimeSetHash(rawSource, nextRuntimeSet) {
56
+ return cache.computeHash([
57
+ rawSource,
58
+ getRuntimeClassSetSignature(runtimeState.twPatcher),
59
+ [...nextRuntimeSet].sort().join("\n")
60
+ ].join("\n\n"));
61
+ }
58
62
  function resolveWithExtensions(base) {
59
63
  for (const ext of MODULE_EXTENSIONS) {
60
64
  const candidate = `${base}${ext}`;
@@ -161,13 +165,12 @@ function createPlugins(options = {}) {
161
165
  }
162
166
  const transformWxss = (options = {}) => createVinylTransform(async (file) => {
163
167
  if (!file.contents) return;
164
- await refreshRuntimeState(true);
165
- await runtimeState.patchPromise;
166
168
  const rawSource = file.contents.toString();
169
+ const nextRuntimeSet = await refreshRuntimeSet(true);
167
170
  await processCachedTask({
168
171
  cache,
169
172
  cacheKey: file.path,
170
- rawSource,
173
+ hash: createRuntimeSetHash(rawSource, nextRuntimeSet),
171
174
  applyResult(source) {
172
175
  file.contents = Buffer.from(source);
173
176
  },
@@ -177,17 +180,17 @@ function createPlugins(options = {}) {
177
180
  async transform() {
178
181
  await runtimeState.patchPromise;
179
182
  const cssHandlerOptions = resolveWxssFileHandlerOptions(file, options);
180
- const css = (hasExplicitGeneratorOptions ? await generateCssByGenerator({
183
+ const css = (await generateCssByGenerator({
181
184
  opts,
182
185
  runtimeState,
183
- runtime: await refreshRuntimeSet(false),
186
+ runtime: nextRuntimeSet,
184
187
  rawSource,
185
188
  file: file.path,
186
189
  cssHandlerOptions,
187
190
  cssUserHandlerOptions: resolveWxssUserHandlerOptions(options),
188
191
  styleHandler,
189
192
  debug
190
- }) : void 0)?.css ?? (await styleHandler(rawSource, cssHandlerOptions)).css;
193
+ }))?.css ?? (await styleHandler(rawSource, cssHandlerOptions)).css;
191
194
  debug("css handle: %s", file.path);
192
195
  return { result: css };
193
196
  }
@@ -195,7 +198,7 @@ function createPlugins(options = {}) {
195
198
  });
196
199
  const transformJs = (options = {}) => createVinylTransform(async (file) => {
197
200
  if (!file.contents) return;
198
- await refreshRuntimeSet(false);
201
+ await refreshRuntimeSet(true);
199
202
  await runtimeState.patchPromise;
200
203
  const filename = path.resolve(file.path);
201
204
  const moduleGraph = resolveModuleGraphOptions(options.moduleGraph);
@@ -232,7 +235,7 @@ function createPlugins(options = {}) {
232
235
  });
233
236
  const transformWxml = (options = {}) => createVinylTransform(async (file) => {
234
237
  if (!file.contents) return;
235
- await refreshRuntimeSet(false);
238
+ await refreshRuntimeSet(true);
236
239
  await runtimeState.patchPromise;
237
240
  const rawSource = file.contents.toString();
238
241
  await processCachedTask({
package/dist/index.d.ts CHANGED
@@ -4,5 +4,5 @@ export { createPlugins } from './gulp';
4
4
  export { weappTailwindcssPostcssPlugin } from './postcss';
5
5
  export type { WeappTailwindcssPostcssPluginOptions } from './postcss';
6
6
  export type * from './types';
7
- export { UnifiedViteWeappTailwindcssPlugin } from './vite';
7
+ export { WeappTailwindcss } from './vite';
8
8
  export { UnifiedWebpackPluginV5, weappTailwindcssPackageDir } from './webpack';
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_generator = require("./generator-mmhXzZnv.js");
2
+ const require_generator = require("./generator-9UEp8OoQ.js");
3
3
  const require_gulp = require("./gulp.js");
4
4
  const require_postcss = require("./postcss.js");
5
- const require_vite = require("./vite-BC9U7ahn.js");
6
- const require_webpack = require("./webpack-DD7A6V0u.js");
7
- exports.UnifiedViteWeappTailwindcssPlugin = require_vite.UnifiedViteWeappTailwindcssPlugin;
5
+ const require_vite = require("./vite-BkMGwDeH.js");
6
+ const require_webpack = require("./webpack-CICGEKT9.js");
8
7
  exports.UnifiedWebpackPluginV5 = require_webpack.UnifiedWebpackPluginV5;
8
+ exports.WeappTailwindcss = require_vite.WeappTailwindcss;
9
9
  exports.createPlugins = require_gulp.createPlugins;
10
10
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
11
11
  exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { t as createWeappTailwindcssGenerator } from "./generator-Y-Ikv4Fu.mjs";
1
+ import { t as createWeappTailwindcssGenerator } from "./generator-Dpp-5s8z.mjs";
2
2
  import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
3
3
  import weappTailwindcssPostcssPlugin from "./postcss.mjs";
4
- import { t as UnifiedViteWeappTailwindcssPlugin } from "./vite-CrlzCNqz.mjs";
5
- import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-Bu6M-Hbw.mjs";
6
- export { UnifiedViteWeappTailwindcssPlugin, UnifiedWebpackPluginV5, createPlugins, createWeappTailwindcssGenerator, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
4
+ import { t as WeappTailwindcss } from "./vite-fDM-UQpR.mjs";
5
+ import { n as weappTailwindcssPackageDir, t as UnifiedWebpackPluginV5 } from "./webpack-D2Wdk28V.mjs";
6
+ export { UnifiedWebpackPluginV5, WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
@@ -1,4 +1,5 @@
1
1
  import type { CreateJsHandlerOptions, JsHandler } from '../types';
2
2
  import { jsHandler } from './babel';
3
3
  export { jsHandler, };
4
+ export { transformLiteralText } from './literal-transform';
4
5
  export declare function createJsHandler(options: CreateJsHandlerOptions): JsHandler;
@@ -0,0 +1,2 @@
1
+ import type { IJsHandlerOptions } from '../types';
2
+ export declare function transformLiteralText(literal: string, options: IJsHandlerOptions): string | undefined;