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

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 (220) hide show
  1. package/README.md +6 -7
  2. package/bin/weapp-tailwindcss.js +1 -21
  3. package/dist/bundle-state-BlXvU4jl.js +530 -0
  4. package/dist/bundle-state-PO6MysTJ.mjs +414 -0
  5. package/dist/bundlers/shared/cache.d.ts +6 -6
  6. package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +2 -0
  7. package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +3 -0
  8. package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +5 -0
  9. package/dist/bundlers/shared/css-cleanup/selectors.d.ts +8 -0
  10. package/dist/bundlers/shared/css-cleanup.d.ts +7 -3
  11. package/dist/bundlers/shared/css-imports.d.ts +3 -3
  12. package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
  13. package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
  14. package/dist/bundlers/shared/generator-css/directives.d.ts +20 -0
  15. package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
  16. package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
  17. package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
  18. package/dist/bundlers/shared/generator-css/markers.d.ts +28 -0
  19. package/dist/bundlers/shared/generator-css/source-files.d.ts +14 -0
  20. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +24 -0
  21. package/dist/bundlers/shared/generator-css.d.ts +16 -22
  22. package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
  23. package/dist/bundlers/shared/style-requests.d.ts +2 -0
  24. package/dist/bundlers/vite/bundle-state.d.ts +1 -0
  25. package/dist/bundlers/vite/css-finalizer.d.ts +7 -1
  26. package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
  27. package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +24 -0
  28. package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +4 -0
  29. package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
  30. package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
  31. package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
  32. package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
  33. package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
  34. package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
  35. package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
  36. package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
  37. package/dist/bundlers/vite/generate-bundle.d.ts +14 -2
  38. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +5 -1
  39. package/dist/bundlers/vite/index.d.ts +1 -1
  40. package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
  41. package/dist/bundlers/vite/postcss-config.d.ts +6 -0
  42. package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
  43. package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -3
  44. package/dist/bundlers/vite/runtime-class-set.d.ts +25 -0
  45. package/dist/bundlers/vite/source-candidates.d.ts +16 -1
  46. package/dist/bundlers/vite/source-scan.d.ts +26 -0
  47. package/dist/bundlers/vite/static-config-content.d.ts +5 -0
  48. package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
  49. package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
  50. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +6 -2
  51. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +9 -3
  52. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -0
  53. package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
  54. package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -6
  55. package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
  56. package/dist/cache/index.d.ts +6 -6
  57. package/dist/cli/context.d.ts +1 -14
  58. package/dist/cli/doctor/types.d.ts +11 -11
  59. package/dist/cli/helpers.d.ts +1 -2
  60. package/dist/cli/mount-options.d.ts +2 -0
  61. package/dist/cli/types.d.ts +0 -2
  62. package/dist/cli/vscode-entry.d.ts +3 -3
  63. package/dist/cli.js +605 -611
  64. package/dist/cli.mjs +614 -620
  65. package/dist/constants.d.ts +1 -2
  66. package/dist/core.js +13 -20
  67. package/dist/core.mjs +8 -14
  68. package/dist/css-macro/postcss.js +3 -2
  69. package/dist/css-macro/postcss.mjs +3 -2
  70. package/dist/css-macro.d.ts +1 -0
  71. package/dist/css-macro.js +2 -2
  72. package/dist/css-macro.mjs +2 -2
  73. package/dist/defaults-B1igPF_e.mjs +150 -0
  74. package/dist/defaults-IHhYxNeU.js +193 -0
  75. package/dist/defaults.d.ts +15 -1
  76. package/dist/defaults.js +6 -131
  77. package/dist/defaults.mjs +2 -129
  78. package/dist/escape.js +10 -2
  79. package/dist/escape.mjs +10 -2
  80. package/dist/generator/index.d.ts +1 -1
  81. package/dist/generator/options.d.ts +9 -8
  82. package/dist/generator/types.d.ts +3 -3
  83. package/dist/generator-DIuglJub.mjs +32 -0
  84. package/dist/generator-N4jy1HCk.js +55 -0
  85. package/dist/generator.js +12 -11
  86. package/dist/generator.mjs +2 -1
  87. package/dist/gulp.js +185 -47
  88. package/dist/gulp.mjs +179 -41
  89. package/dist/incremental-runtime-class-set-CJ0Pnsw2.js +2348 -0
  90. package/dist/incremental-runtime-class-set-hF-uiw6W.mjs +2285 -0
  91. package/dist/index.d.ts +1 -1
  92. package/dist/index.js +6 -6
  93. package/dist/index.mjs +5 -5
  94. package/dist/js/babel/cache-options.d.ts +3 -0
  95. package/dist/js/babel/parse.d.ts +7 -4
  96. package/dist/js/index.d.ts +1 -0
  97. package/dist/js/literal-transform.d.ts +2 -0
  98. package/dist/js/precheck.d.ts +2 -2
  99. package/dist/lightningcss/style-handler/selector-transform.d.ts +1 -1
  100. package/dist/lightningcss/style-handler.d.ts +3 -3
  101. package/dist/logger-CZUxvJJD.mjs +2 -0
  102. package/dist/logger-EVNB9z7i.js +1 -0
  103. package/dist/postcss/config-directive.d.ts +1 -0
  104. package/dist/postcss/context.d.ts +9 -0
  105. package/dist/postcss/source-files.d.ts +8 -0
  106. package/dist/postcss/tailwind-version.d.ts +3 -0
  107. package/dist/postcss-D4UdbBQ6.mjs +228 -0
  108. package/dist/postcss-DlY-YRvA.js +237 -0
  109. package/dist/postcss.d.ts +2 -2
  110. package/dist/postcss.js +3 -276
  111. package/dist/postcss.mjs +1 -269
  112. package/dist/{recorder-gYSNLfOP.js → precheck-BjEbVEpX.js} +218 -314
  113. package/dist/{recorder-zsgatmkB.mjs → precheck-tbk626YL.mjs} +186 -281
  114. package/dist/presets.js +13 -11
  115. package/dist/presets.mjs +11 -9
  116. package/dist/reset.d.ts +1 -0
  117. package/dist/runtime-registry-D5qnaSpo.js +5516 -0
  118. package/dist/shared/mpx.d.ts +1 -0
  119. package/dist/source-candidates-BrvneDDd.mjs +209 -0
  120. package/dist/source-candidates-gxijpPI3.js +222 -0
  121. package/dist/tailwindcss/miniprogram.d.ts +5 -1
  122. package/dist/tailwindcss/patcher-options.d.ts +3 -51
  123. package/dist/tailwindcss/patcher.d.ts +1 -2
  124. package/dist/tailwindcss/runtime/cache.d.ts +4 -3
  125. package/dist/tailwindcss/runtime-patch.d.ts +5 -0
  126. package/dist/tailwindcss/runtime.d.ts +11 -12
  127. package/dist/tailwindcss/source-scan.d.ts +35 -0
  128. package/dist/tailwindcss/targets.d.ts +1 -5
  129. package/dist/tailwindcss/v3-engine/types.d.ts +17 -14
  130. package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
  131. package/dist/tailwindcss/v4/css-sources.d.ts +5 -0
  132. package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
  133. package/dist/tailwindcss/v4/patcher.d.ts +1 -0
  134. package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
  135. package/dist/tailwindcss/v4-engine/types.d.ts +17 -5
  136. package/dist/tailwindcss/version.d.ts +4 -0
  137. package/dist/tailwindcss-BhG7BtB-.js +651 -0
  138. package/dist/tailwindcss-c6ROlNNW.mjs +600 -0
  139. package/dist/typedoc.export.d.ts +0 -2
  140. package/dist/types/index.d.ts +51 -48
  141. package/dist/types/shared.d.ts +3 -0
  142. package/dist/types/user-defined-options/general.d.ts +23 -23
  143. package/dist/types/user-defined-options/important.d.ts +31 -28
  144. package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
  145. package/dist/types/user-defined-options/matcher.d.ts +6 -6
  146. package/dist/uni-app-x/vite.d.ts +1 -1
  147. package/dist/utils/disabled.d.ts +2 -3
  148. package/dist/utils/object.d.ts +9 -0
  149. package/dist/{utils-DmC9_In3.js → utils-4ODFyoqD.js} +1 -1
  150. package/dist/{utils-7DUGTFED.mjs → utils-CGBVVNm6.mjs} +1 -1
  151. package/dist/v3-engine-5LoZUH-4.js +3695 -0
  152. package/dist/v3-engine-DIXDEDmL.mjs +3406 -0
  153. package/dist/{vite-CrlzCNqz.mjs → vite-B5faZcbE.mjs} +1256 -1088
  154. package/dist/vite-MyXBNux0.js +2368 -0
  155. package/dist/vite.d.ts +1 -2
  156. package/dist/vite.js +3 -4
  157. package/dist/vite.mjs +2 -2
  158. package/dist/weapp-tw-css-import-rewrite-loader.js +5157 -16
  159. package/dist/weapp-tw-runtime-classset-loader.js +32 -7
  160. package/dist/webpack-BnVyDmsD.mjs +836 -0
  161. package/dist/webpack-Mz1V0A9p.js +846 -0
  162. package/dist/webpack.js +1 -1
  163. package/dist/webpack.mjs +1 -1
  164. package/package.json +27 -37
  165. package/dist/bundlers/shared/generator-candidates.d.ts +0 -5
  166. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
  167. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
  168. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
  169. package/dist/bundlers/webpack/shared/css-imports.d.ts +0 -6
  170. package/dist/cli/config.d.ts +0 -5
  171. package/dist/cli/helpers/patch-cwd.d.ts +0 -1
  172. package/dist/cli/mount-options/patch-status.d.ts +0 -2
  173. package/dist/cli/patch-options.d.ts +0 -6
  174. package/dist/cli/tokens.d.ts +0 -4
  175. package/dist/cli/workspace/package-dirs.d.ts +0 -3
  176. package/dist/cli/workspace/patch-package.d.ts +0 -3
  177. package/dist/cli/workspace/patch-utils.d.ts +0 -3
  178. package/dist/cli/workspace/types.d.ts +0 -11
  179. package/dist/cli/workspace/workspace-globs.d.ts +0 -2
  180. package/dist/cli/workspace/workspace-io.d.ts +0 -1
  181. package/dist/cli/workspace/workspace-lock.d.ts +0 -1
  182. package/dist/cli/workspace.d.ts +0 -2
  183. package/dist/css-imports-BbrbluP9.js +0 -177
  184. package/dist/css-imports-CSdPq_Sc.mjs +0 -128
  185. package/dist/experimental/index.d.ts +0 -2
  186. package/dist/experimental/oxc/ast-utils.d.ts +0 -30
  187. package/dist/experimental/oxc/index.d.ts +0 -2
  188. package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
  189. package/dist/experimental/shared/cache.d.ts +0 -3
  190. package/dist/experimental/shared/transform.d.ts +0 -3
  191. package/dist/experimental/shared.d.ts +0 -8
  192. package/dist/experimental/swc/ast-utils.d.ts +0 -30
  193. package/dist/experimental/swc/index.d.ts +0 -2
  194. package/dist/experimental/swc/module-specifiers.d.ts +0 -2
  195. package/dist/generator-Y-Ikv4Fu.mjs +0 -1177
  196. package/dist/generator-css-B5ejWUMv.mjs +0 -1098
  197. package/dist/generator-css-D3OdPRiS.js +0 -1125
  198. package/dist/generator-mmhXzZnv.js +0 -1276
  199. package/dist/js/syntax.d.ts +0 -10
  200. package/dist/loader-anchors-CNkWT8hx.js +0 -273
  201. package/dist/loader-anchors-TrU7EUr7.mjs +0 -205
  202. package/dist/logger-BZ45DZJT.js +0 -1003
  203. package/dist/logger-BoVx1Dbt.mjs +0 -935
  204. package/dist/patcher-options-6gJN2EXy.js +0 -115
  205. package/dist/patcher-options-DQfR5xxT.mjs +0 -92
  206. package/dist/tailwindcss/recorder.d.ts +0 -13
  207. package/dist/tailwindcss/targets/paths.d.ts +0 -13
  208. package/dist/tailwindcss/targets/record-io.d.ts +0 -5
  209. package/dist/tailwindcss/targets/recorder.d.ts +0 -3
  210. package/dist/tailwindcss/targets/types.d.ts +0 -35
  211. package/dist/types/disabled-options.d.ts +0 -4
  212. package/dist/vite-BC9U7ahn.js +0 -2199
  213. package/dist/webpack-Bu6M-Hbw.mjs +0 -441
  214. package/dist/webpack-DD7A6V0u.js +0 -456
  215. package/dist/webpack4.d.ts +0 -4
  216. package/dist/webpack4.js +0 -387
  217. package/dist/webpack4.mjs +0 -379
  218. package/scripts/postinstall.mjs +0 -59
  219. /package/dist/{constants-B-_T5UnW.mjs → constants-BG12WAKw.mjs} +0 -0
  220. /package/dist/{constants-p1dyh1x1.js → constants-BeeyfJ9k.js} +0 -0
@@ -1,43 +1,37 @@
1
1
  import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
2
+ import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
3
  import type { InternalUserDefinedOptions } from '../../types';
4
+ export { hasTailwindSourceDirectives, normalizeTailwindSourceForGenerator, removeTailwindSourceDirectives, resolveCssEntrySource, } from './generator-css/directives';
5
+ export { removeTailwindApplyRules, } from './generator-css/legacy-compat';
6
+ export { inheritLegacyUnitConvertedDeclarations, } from './generator-css/legacy-units';
7
+ export { createCssAppend, hasTailwindGeneratedCss, hasTailwindGeneratedCssMarkers, removeTailwindGeneratedCssByBanner, splitGeneratorPlaceholderCssBySourceOrder, splitTailwindGeneratedCssByBanner, splitTailwindV4GeneratedCss, splitTailwindV4GeneratedCssBySourceOrder, stripGeneratorPlaceholderMarkers, stripTailwindBanner, stripTailwindBanners, } from './generator-css/markers';
8
+ export { resolveGeneratorSource, } from './generator-css/source-resolver';
3
9
  export interface GenerateCssByGeneratorOptions {
4
10
  opts: InternalUserDefinedOptions;
5
11
  runtimeState: {
6
12
  twPatcher: InternalUserDefinedOptions['twPatcher'];
7
- patchPromise: Promise<void>;
13
+ readyPromise: Promise<void>;
8
14
  };
9
15
  runtime: Set<string>;
10
16
  rawSource: string;
11
17
  file: string;
12
18
  cssHandlerOptions: IStyleHandlerOptions;
13
19
  cssUserHandlerOptions: IStyleHandlerOptions;
20
+ getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
14
21
  styleHandler: InternalUserDefinedOptions['styleHandler'];
15
22
  debug: (format: string, ...args: unknown[]) => void;
23
+ previousCss?: string | undefined;
16
24
  }
17
25
  export interface GenerateCssByGeneratorResult {
18
26
  css: string;
19
27
  target: string;
20
- source: 'generator' | 'generator-forced';
28
+ source: 'generator';
29
+ dependencies: string[];
30
+ incremental?: boolean | undefined;
21
31
  }
22
- export declare function createCssAppend(base: string, extra: string): string;
23
- export declare function splitTailwindV4GeneratedCss(rawSource: string, rawTailwindCss: string): string | undefined;
24
- export declare function removeTailwindGeneratedCssByBanner(rawSource: string): string | undefined;
25
- export declare function stripTailwindBanner(css: string): string;
26
- export declare function stripTailwindBanners(css: string): string;
27
- export declare function stripGeneratorPlaceholderMarkers(css: string): string;
28
- export declare function hasTailwindGeneratedCss(rawSource: string): boolean;
29
- export declare function hasTailwindGeneratedCssMarkers(rawSource: string): boolean;
30
- export declare function inheritLegacyUnitConvertedDeclarations(css: string, legacyCss: string): string;
31
- export declare function removeTailwindSourceDirectives(rawSource: string): string;
32
- export declare function hasTailwindSourceDirectives(rawSource: string): boolean;
33
- export declare function resolveCssEntrySource(rawSource: string, base: string, options?: {
34
- removeConfig?: boolean;
35
- }): {
36
- css: string;
37
- config: string | undefined;
38
- configRequest: string | undefined;
39
- base: string;
40
- } | undefined;
41
- export declare function resolveGeneratorSource(majorVersion: number | undefined, runtimeState: GenerateCssByGeneratorOptions['runtimeState'], rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions): Promise<import("@/generator").TailwindV3ResolvedSource | import("tailwindcss-patch").TailwindV4ResolvedSource>;
42
32
  export declare function isPureLocalCssImportWrapper(css: string): boolean;
43
33
  export declare function generateCssByGenerator(options: GenerateCssByGeneratorOptions): Promise<GenerateCssByGeneratorResult | undefined>;
34
+ export interface ValidateCandidatesByGeneratorOptions extends Omit<GenerateCssByGeneratorOptions, 'runtime'> {
35
+ candidates: Set<string>;
36
+ }
37
+ export declare function validateCandidatesByGenerator(options: ValidateCandidatesByGeneratorOptions): Promise<Set<string>>;
@@ -0,0 +1,22 @@
1
+ export interface HmrTimingDetails {
2
+ emit?: boolean;
3
+ file?: string;
4
+ hooks?: Record<string, HmrTimingHookSummary>;
5
+ metric?: 'hook' | 'total';
6
+ wallMs?: number;
7
+ }
8
+ export interface HmrTimingHookSummary {
9
+ count: number;
10
+ durationMs: number;
11
+ maxMs: number;
12
+ }
13
+ type HmrTimingBundler = 'vite' | 'webpack' | 'gulp';
14
+ export interface HmrTimingRecorder {
15
+ emitTotal: (phase?: string) => void;
16
+ measure: <T>(phase: string, task: () => T | Promise<T>, details?: HmrTimingDetails) => Promise<T>;
17
+ record: (phase: string, durationMs: number, details?: HmrTimingDetails) => void;
18
+ }
19
+ export declare function shouldEmitHmrTiming(): boolean;
20
+ export declare function emitHmrTiming(bundler: HmrTimingBundler, phase: string, durationMs: number, details?: HmrTimingDetails): void;
21
+ export declare function createHmrTimingRecorder(bundler: HmrTimingBundler): HmrTimingRecorder;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function stripRequestQuery(request: string): string;
2
+ export declare function isSourceStyleRequest(request: string | undefined): boolean;
@@ -31,6 +31,7 @@ export interface BundleBuildState {
31
31
  runtimeAffectingHashByFile: Map<string, string>;
32
32
  linkedByEntry: Map<string, Set<string>>;
33
33
  dependentsByLinkedFile: Map<string, Set<string>>;
34
+ generatorCandidateSignature?: string | undefined;
34
35
  }
35
36
  interface UpdateBundleBuildStateOptions {
36
37
  incremental?: boolean;
@@ -1,11 +1,12 @@
1
1
  import type { OutputAsset } from 'rollup';
2
2
  import type { Plugin, ResolvedConfig } from 'vite';
3
+ import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
3
4
  import type { InternalUserDefinedOptions } from '../../types';
4
5
  interface CssFinalizerContext {
5
6
  opts: InternalUserDefinedOptions;
6
7
  runtimeState: {
7
8
  twPatcher: InternalUserDefinedOptions['twPatcher'];
8
- patchPromise: Promise<void>;
9
+ readyPromise: Promise<void>;
9
10
  };
10
11
  ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
11
12
  isCssAssetProcessed: (asset: OutputAsset, file?: string) => boolean;
@@ -13,10 +14,15 @@ interface CssFinalizerContext {
13
14
  debug: (format: string, ...args: unknown[]) => void;
14
15
  getResolvedConfig: () => ResolvedConfig | undefined;
15
16
  recordCssAssetResult?: (file: string, css: string) => void;
17
+ recordViteProcessedCssAssetResult?: (file: string, css: string) => void;
18
+ getViteProcessedCssAssetResults?: () => Iterable<[string, string]>;
16
19
  getRecordedGeneratorCandidates?: () => Set<string> | undefined;
17
20
  getSourceCandidates?: () => Set<string>;
21
+ getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
18
22
  waitForSourceCandidateSyncs?: () => Promise<void>;
19
23
  rememberMainCssSource?: (file: string, rawSource: string) => void;
24
+ getRememberedMainCssSource?: (file: string) => string | undefined;
25
+ isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
20
26
  }
21
27
  export declare function createViteCssFinalizerOutputPlugin(context: CssFinalizerContext): Plugin;
22
28
  export {};
@@ -0,0 +1,2 @@
1
+ export declare function collectUnescapedDynamicCandidates(source: string): string[];
2
+ export declare function collectLegacyContainerCompatCandidates(sourceCandidates: Set<string>, candidates: Set<string>): Set<string>;
@@ -0,0 +1,24 @@
1
+ import type { InternalUserDefinedOptions, IStyleHandlerOptions } from '../../../types';
2
+ type CssHandlerOptions = IStyleHandlerOptions & {
3
+ postcssOptions: {
4
+ options: {
5
+ from: string;
6
+ };
7
+ };
8
+ majorVersion: number | undefined;
9
+ sourceOptions?: {
10
+ outputRoot?: string | undefined;
11
+ } | undefined;
12
+ };
13
+ interface CssHandlerOptionsCacheOptions {
14
+ getAppType: () => InternalUserDefinedOptions['appType'];
15
+ mainCssChunkMatcher: InternalUserDefinedOptions['mainCssChunkMatcher'];
16
+ getMajorVersion: () => number | undefined;
17
+ getOutputRoot?: (() => string | undefined) | undefined;
18
+ }
19
+ export interface CssHandlerOptionsCache {
20
+ getCssHandlerOptions: (file: string) => CssHandlerOptions;
21
+ getCssUserHandlerOptions: (file: string) => CssHandlerOptions;
22
+ }
23
+ export declare function createCssHandlerOptionsCache(options: CssHandlerOptionsCacheOptions): CssHandlerOptionsCache;
24
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { InternalUserDefinedOptions } from '../../../types';
2
+ export declare function createCssTransformShareScope(file: string, rawSource: string): string;
3
+ export declare function createCssTransformShareScopeKey(opts: InternalUserDefinedOptions, file: string, rawSource: string): string;
4
+ export declare function createCssRuntimeSignature(runtimeSignature: string, generatorCandidateSignature: string): string;
@@ -0,0 +1 @@
1
+ export declare function hasOmittedKnownBundleFiles(currentBundleFiles: string[], previousBundleFiles: Iterable<string>): boolean;
@@ -0,0 +1,2 @@
1
+ import type { OutputEntry } from '../bundle-entries';
2
+ export declare function createJsEntryResolver(jsEntries: Map<string, OutputEntry>): (id: string) => OutputEntry | undefined;
@@ -0,0 +1,8 @@
1
+ import type { CreateJsHandlerOptions, InternalUserDefinedOptions } from '../../../types';
2
+ interface JsHandlerOptionsFactoryOptions {
3
+ getMajorVersion: () => number | undefined;
4
+ moduleGraph: CreateJsHandlerOptions['moduleGraph'];
5
+ }
6
+ export declare function resolveUniAppXJsTransformEnabled(uniAppX: InternalUserDefinedOptions['uniAppX'] | undefined): boolean;
7
+ export declare function createJsHandlerOptionsFactory(options: JsHandlerOptionsFactoryOptions): (absoluteFilename: string, extra?: CreateJsHandlerOptions) => CreateJsHandlerOptions;
8
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { OutputEntry } from '../bundle-entries';
2
+ import type { LinkedJsModuleResult } from '../../../types';
3
+ interface LinkedUpdateHelpersOptions {
4
+ jsEntries: Map<string, OutputEntry>;
5
+ onUpdate: (fileName: string, previous: string, next: string) => void;
6
+ debug: (format: string, ...args: unknown[]) => void;
7
+ }
8
+ export declare function createLinkedUpdateHelpers(options: LinkedUpdateHelpersOptions): {
9
+ applyLinkedUpdates: (linked?: Record<string, LinkedJsModuleResult>) => void;
10
+ pendingLinkedUpdates: (() => void)[];
11
+ };
12
+ export declare function collectLinkedFileNames(linked: Record<string, LinkedJsModuleResult> | undefined, getJsEntry: (id: string) => OutputEntry | undefined, linkedSet: Set<string> | undefined): void;
13
+ export {};
@@ -0,0 +1,17 @@
1
+ export interface BundleMetric {
2
+ total: number;
3
+ transformed: number;
4
+ cacheHits: number;
5
+ elapsed: number;
6
+ }
7
+ export interface BundleMetrics {
8
+ runtimeSet: number;
9
+ html: BundleMetric;
10
+ js: BundleMetric;
11
+ css: BundleMetric;
12
+ }
13
+ export declare function formatDebugFileList(files: Set<string>, limit?: number): string;
14
+ export declare function createEmptyMetrics(): BundleMetrics;
15
+ export declare function measureElapsed(start: number): number;
16
+ export declare function formatCacheHitRate(metric: BundleMetric): string;
17
+ export declare function formatMs(value: number): string;
@@ -0,0 +1,9 @@
1
+ import type { BundleSnapshot } from '../bundle-state';
2
+ interface LogBundleProcessPlanOptions {
3
+ debug: (format: string, ...args: unknown[]) => void;
4
+ snapshot: BundleSnapshot;
5
+ useIncrementalMode: boolean;
6
+ iteration: number;
7
+ }
8
+ export declare function logBundleProcessPlan(options: LogBundleProcessPlanOptions): void;
9
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { OutputAsset } from 'rollup';
2
+ interface GeneratorDependencyContext {
3
+ addWatchFile?: (id: string) => void;
4
+ }
5
+ export declare function createReplayCssAsset(fileName: string, source: string): OutputAsset;
6
+ export declare function registerGeneratorDependencies(ctx: GeneratorDependencyContext, dependencies: readonly string[] | undefined): void;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { EntryType } from '../bundle-state';
2
+ export declare function summarizeStringDiff(previous: string, next: string): string;
3
+ export declare function createLinkedImpactSignature(entry: string, linkedImpactsByEntry: Map<string, Set<string>>, sourceHashByFile: Map<string, string>): string | undefined;
4
+ export declare function createJsHashSalt(runtimeSignature: string, linkedImpactSignature?: string): string;
5
+ export declare function createStableTextSignature(input: string): string;
6
+ export declare function createCandidateSignature(candidates: Set<string>): string;
7
+ export declare function getSnapshotHash(snapshotMap: Map<string, string>, file: string, fallback: string): string;
8
+ export declare function hasRuntimeAffectingSourceChanges(changedByType: Record<EntryType, Set<string>>): boolean;
@@ -1,33 +1,45 @@
1
1
  import type { OutputAsset, OutputChunk } from 'rollup';
2
2
  import type { ResolvedConfig } from 'vite';
3
+ import type { HmrTimingRecorder } from '../shared/hmr-timing';
3
4
  import type { BundleSnapshot } from './bundle-state';
5
+ import type { TailwindSourceEntry } from '../../tailwindcss/source-scan';
4
6
  import type { InternalUserDefinedOptions } from '../../types';
5
7
  interface GenerateBundleContext {
6
8
  opts: InternalUserDefinedOptions;
7
9
  runtimeState: {
8
10
  twPatcher: InternalUserDefinedOptions['twPatcher'];
9
- patchPromise: Promise<void>;
11
+ readyPromise: Promise<void>;
10
12
  };
11
13
  ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
12
- ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean) => Promise<Set<string>>;
14
+ ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
15
+ allowBaselineOnlyInitialSync?: boolean | undefined;
16
+ baseClassSet?: Set<string> | undefined;
17
+ }) => Promise<Set<string>>;
13
18
  debug: (format: string, ...args: unknown[]) => void;
14
19
  getResolvedConfig: () => ResolvedConfig | undefined;
15
20
  markCssAssetProcessed?: (asset: OutputAsset, file?: string) => void;
21
+ isViteProcessedCssAsset?: (asset: OutputAsset, file?: string) => boolean;
16
22
  recordCssAssetResult?: (file: string, css: string) => void;
23
+ recordViteProcessedCssAssetResult?: (file: string, css: string) => void;
24
+ getViteProcessedCssAssetResults?: () => Iterable<[string, string]>;
17
25
  getSourceCandidates?: () => Set<string>;
26
+ getSourceCandidatesForEntries?: ((entries: TailwindSourceEntry[] | undefined) => Set<string>) | undefined;
18
27
  waitForSourceCandidateSyncs?: () => Promise<void>;
19
28
  rememberMainCssSource?: (file: string, rawSource: string, cssRuntimeSignature: string) => void;
20
29
  getRememberedMainCssSources?: () => Map<string, string>;
21
30
  getRememberedMainCssSignature?: (file: string) => string | undefined;
22
31
  setRememberedMainCssSignature?: (file: string, cssRuntimeSignature: string) => void;
23
32
  recordGeneratorCandidates?: (candidates: Set<string>) => void;
33
+ hmrTimingRecorder?: HmrTimingRecorder;
24
34
  }
25
35
  interface GenerateBundleThis {
36
+ addWatchFile?: (id: string) => void;
26
37
  emitFile?: (emittedFile: {
27
38
  type: 'asset';
28
39
  fileName: string;
29
40
  source: string;
30
41
  }) => string;
31
42
  }
43
+ export declare function resolveReplayCssOutputFile(rootDir: string, file: string): string;
32
44
  export declare function createGenerateBundleHook(context: GenerateBundleContext): (this: GenerateBundleThis, _opt: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
33
45
  export {};
@@ -10,9 +10,13 @@ type ExtractValidCandidatesFn = (options?: MemoryExtractValidCandidatesOptions)
10
10
  type ExtractRawCandidateResult = Awaited<ReturnType<typeof extractRawCandidatesWithPositions>>;
11
11
  type ExtractRawCandidatesFn = (content: string, extension?: string) => Promise<ExtractRawCandidateResult>;
12
12
  export interface BundleRuntimeClassSetManager {
13
- sync: (patcher: TailwindcssPatcherLike, snapshot: BundleSnapshot) => Promise<Set<string>>;
13
+ sync: (patcher: TailwindcssPatcherLike, snapshot: BundleSnapshot, options?: BundleRuntimeClassSetSyncOptions) => Promise<Set<string>>;
14
14
  reset: () => Promise<void>;
15
15
  }
16
+ export interface BundleRuntimeClassSetSyncOptions {
17
+ baseClassSet?: Set<string> | undefined;
18
+ skipInitialFullScanWithBase?: boolean | undefined;
19
+ }
16
20
  interface CreateBundleRuntimeClassSetManagerOptions {
17
21
  extractCandidates?: ExtractValidCandidatesFn;
18
22
  extractRawCandidates?: ExtractRawCandidatesFn;
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import type { UserDefinedOptions } from '../../types';
3
- export declare function UnifiedViteWeappTailwindcssPlugin(options?: UserDefinedOptions): Plugin[] | undefined;
3
+ export declare function WeappTailwindcss(options?: UserDefinedOptions): Plugin[] | undefined;
@@ -0,0 +1,5 @@
1
+ import type { Plugin } from 'vite';
2
+ export declare function getPostcssPluginName(plugin: unknown): string | undefined;
3
+ export declare function removeTailwindPostcssPlugins(plugins: unknown[]): number;
4
+ export declare function removeTailwindVitePlugins(plugins: Plugin[]): number;
5
+ export declare function disableAndRemoveTailwindVitePlugins(plugins: unknown[]): number;
@@ -0,0 +1,6 @@
1
+ import postcssrc from 'postcss-load-config';
2
+ export declare function resolveFilteredPostcssConfig(root: string): Promise<{
3
+ options: import("postcss").ProcessOptions<import("postcss").Document | import("postcss").Root>;
4
+ plugins: postcssrc.ResultPlugin[];
5
+ removed: number;
6
+ } | undefined>;
@@ -0,0 +1,32 @@
1
+ import type { OutputAsset, OutputBundle } from 'rollup';
2
+ import type { InternalUserDefinedOptions } from '../../types';
3
+ interface CssAssetMarkerMatcher {
4
+ (asset: OutputAsset, file?: string): boolean;
5
+ }
6
+ interface CssAssetProcessedMarker {
7
+ (asset: OutputAsset, file?: string): void;
8
+ }
9
+ interface CssAssetResultRecorder {
10
+ (file: string, css: string): void;
11
+ }
12
+ interface CssAssetResultsGetter {
13
+ (): Iterable<[string, string]>;
14
+ }
15
+ interface CollectViteProcessedCssAssetOptions {
16
+ isViteProcessedCssAsset?: CssAssetMarkerMatcher | undefined;
17
+ markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
18
+ recordCssAssetResult?: CssAssetResultRecorder | undefined;
19
+ recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
20
+ debug?: ((format: string, ...args: unknown[]) => void) | undefined;
21
+ }
22
+ interface InjectViteProcessedCssAssetOptions {
23
+ opts: InternalUserDefinedOptions;
24
+ getViteProcessedCssAssetResults?: CssAssetResultsGetter | undefined;
25
+ markCssAssetProcessed?: CssAssetProcessedMarker | undefined;
26
+ recordCssAssetResult?: CssAssetResultRecorder | undefined;
27
+ debug?: ((format: string, ...args: unknown[]) => void) | undefined;
28
+ onUpdate?: ((file: string, original: string, generated: string) => void) | undefined;
29
+ }
30
+ export declare function collectViteProcessedCssAssetResults(bundle: OutputBundle, options: CollectViteProcessedCssAssetOptions): number;
31
+ export declare function injectViteProcessedCssIntoMainCssAssets(bundle: OutputBundle, options: InjectViteProcessedCssAssetOptions): number;
32
+ export {};
@@ -1,11 +1,16 @@
1
1
  import type { Plugin } from 'vite';
2
2
  import type { AppType } from '../../types';
3
3
  interface RewriteCssImportsOptions {
4
- appType?: AppType;
5
- getAppType?: () => AppType | undefined;
4
+ appType?: AppType | undefined;
5
+ getAppType?: (() => AppType | undefined) | undefined;
6
+ generateTailwindCss?: ((id: string, code: string, hookContext?: {
7
+ addWatchFile?: (id: string) => void;
8
+ }) => Promise<string | undefined> | string | undefined) | undefined;
9
+ shouldOwnTailwindGeneration?: boolean | undefined;
6
10
  shouldRewrite: boolean;
7
- rootImport?: string;
11
+ rootImport?: string | undefined;
8
12
  weappTailwindcssDirPosix: string;
13
+ onTailwindRootCss?: ((id: string, code: string) => Promise<void> | void) | undefined;
9
14
  }
10
15
  export declare function createRewriteCssImportsPlugins(options: RewriteCssImportsOptions): Plugin[];
11
16
  export {};
@@ -0,0 +1,25 @@
1
+ import type { BundleSnapshot } from './bundle-state';
2
+ import type { InternalUserDefinedOptions } from '../../types';
3
+ interface CreateViteRuntimeClassSetOptions {
4
+ opts: InternalUserDefinedOptions;
5
+ initialTwPatcher: InternalUserDefinedOptions['twPatcher'];
6
+ refreshTailwindcssPatcher: InternalUserDefinedOptions['refreshTailwindcssPatcher'];
7
+ uniAppXEnabled: boolean;
8
+ customAttributesEntities: unknown;
9
+ disabledDefaultTemplateHandler: boolean;
10
+ debug: (format: string, ...args: unknown[]) => void;
11
+ }
12
+ export declare function createViteRuntimeClassSet(options: CreateViteRuntimeClassSetOptions): {
13
+ runtimeState: {
14
+ twPatcher: import("@/types").TailwindcssPatcherLike;
15
+ readyPromise: Promise<void>;
16
+ refreshTailwindcssPatcher: (options?: import("@/types").RefreshTailwindcssPatcherOptions) => Promise<import("@/types").TailwindcssPatcherLike>;
17
+ };
18
+ refreshRuntimeState: (force: boolean) => Promise<void>;
19
+ ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
20
+ ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
21
+ allowBaselineOnlyInitialSync?: boolean | undefined;
22
+ baseClassSet?: Set<string> | undefined;
23
+ }) => Promise<Set<string>>;
24
+ };
25
+ export {};
@@ -1,14 +1,29 @@
1
+ import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
1
2
  export interface SourceCandidateCollector {
2
3
  sync: (id: string, source: string) => Promise<void>;
4
+ merge: (id: string, source: string) => Promise<void>;
3
5
  syncFile: (id: string) => Promise<void>;
6
+ syncCurrentFile: (id: string) => Promise<void>;
4
7
  scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
8
+ syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
5
9
  remove: (id: string) => void;
6
10
  values: () => Set<string>;
11
+ valuesForEntries: (entries: TailwindSourceEntry[] | undefined) => Set<string>;
12
+ snapshot: () => SourceCandidateCollectorSnapshot;
13
+ restore: (snapshot: SourceCandidateCollectorSnapshot) => void;
7
14
  clear: () => void;
8
15
  }
16
+ export interface SourceCandidateCollectorSnapshot {
17
+ candidatesById: Array<[string, string[]]>;
18
+ scanCandidatesById?: Array<[string, string[]]> | undefined;
19
+ transformCandidatesById?: Array<[string, string[]]> | undefined;
20
+ inlineExcludedCandidates: string[];
21
+ inlineIncludedCandidates: string[];
22
+ }
9
23
  interface ScanSourceCandidateRootOptions {
10
24
  root: string;
11
- outDir?: string;
25
+ outDir?: string | undefined;
26
+ entries?: TailwindSourceEntry[] | undefined;
12
27
  }
13
28
  export declare function isSourceCandidateRequest(id: string): boolean;
14
29
  export declare function createSourceCandidateCollector(): SourceCandidateCollector;
@@ -0,0 +1,26 @@
1
+ import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
+ import type { TailwindcssPatcherLike, UserDefinedOptions } from '../../types';
3
+ export interface ResolvedTailwindV4CssEntries {
4
+ entries: TailwindSourceEntry[];
5
+ explicit: boolean;
6
+ inlineCandidates: TailwindInlineSourceCandidates;
7
+ dependencies: string[];
8
+ }
9
+ export interface ResolvedViteSourceScan {
10
+ dependencies?: string[] | undefined;
11
+ entries?: TailwindSourceEntry[] | undefined;
12
+ explicit?: boolean | undefined;
13
+ inlineCandidates?: TailwindInlineSourceCandidates | undefined;
14
+ }
15
+ interface ResolveViteSourceScanOptions {
16
+ root?: string | undefined;
17
+ outDir?: string | undefined;
18
+ }
19
+ export declare function mergeTailwindInlineSourceCandidates(allInlineCandidates: Array<TailwindInlineSourceCandidates | undefined>): TailwindInlineSourceCandidates | undefined;
20
+ export declare function resolveTailwindV4EntriesFromCss(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
21
+ export declare function resolveViteTailwindV4CssDependencies(css: string, base: string): Promise<string[]>;
22
+ export declare function resolveTailwindV4EntriesFromCssCached(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
23
+ export declare function discoverTailwindV4CssEntries(root: string, outDir: string | undefined): Promise<string[]>;
24
+ export declare function resolveViteSourceScanEntries(options: UserDefinedOptions, patcher: TailwindcssPatcherLike, scanOptions?: ResolveViteSourceScanOptions): Promise<ResolvedViteSourceScan | undefined>;
25
+ export declare function createViteSourceScanMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
26
+ export {};
@@ -0,0 +1,5 @@
1
+ type StaticContentValue = string | StaticContentValue[] | {
2
+ files: StaticContentValue;
3
+ };
4
+ export declare function readStaticConfigContent(configPath: string): StaticContentValue | undefined;
5
+ export {};
@@ -0,0 +1 @@
1
+ export declare function resolveImplicitTailwindcssBasedirFromViteRoot(root: string): string;
@@ -15,6 +15,12 @@ interface WebpackWatchChangeLike {
15
15
  modifiedFiles?: Set<string>;
16
16
  removedFiles?: Set<string>;
17
17
  }
18
+ interface RuntimeWatchDependenciesLike {
19
+ files?: Iterable<string>;
20
+ contexts?: Iterable<string>;
21
+ }
18
22
  export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
23
+ export declare function createRuntimeAwareCssHash(assetHash: string | undefined, sourceHash: string, runtimeSetHash: string): string;
19
24
  export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
25
+ export declare function isWatchFileInRuntimeDependencies(file: string, dependencies: RuntimeWatchDependenciesLike): boolean;
20
26
  export {};
@@ -1,16 +1,20 @@
1
1
  import type { Compiler } from 'webpack';
2
+ import type { BundleRuntimeClassSetManager } from '../../vite/incremental-runtime-class-set';
2
3
  import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
4
  interface SetupWebpackV5ProcessAssetsHookOptions {
4
5
  compiler: Compiler;
5
6
  options: InternalUserDefinedOptions;
6
- appType?: AppType;
7
+ appType?: AppType | undefined;
7
8
  runtimeState: {
8
9
  twPatcher: InternalUserDefinedOptions['twPatcher'];
9
- patchPromise: Promise<void>;
10
+ readyPromise: Promise<void>;
10
11
  };
11
12
  getRuntimeRefreshRequirement: () => boolean;
12
13
  refreshRuntimeMetadata: (force: boolean) => Promise<void>;
14
+ isWebpackProcessedCssAsset?: ((file: string, rawSource: string) => boolean) | undefined;
13
15
  consumeRuntimeRefreshRequirement: () => void;
16
+ isWatchMode?: (() => boolean) | undefined;
17
+ runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
14
18
  debug: (format: string, ...args: unknown[]) => void;
15
19
  }
16
20
  export declare function setupWebpackV5ProcessAssetsHook(options: SetupWebpackV5ProcessAssetsHookOptions): void;
@@ -1,18 +1,24 @@
1
+ import type { TailwindV4CssSource } from 'tailwindcss-patch';
1
2
  import type { Compiler } from 'webpack';
3
+ import type { TailwindRuntimeState } from '../../../tailwindcss/runtime';
2
4
  import type { AppType, InternalUserDefinedOptions } from '../../../types';
3
5
  interface SetupWebpackV5LoadersOptions {
4
6
  compiler: Compiler;
5
7
  options: InternalUserDefinedOptions;
6
- appType?: AppType;
8
+ appType?: AppType | undefined;
7
9
  weappTailwindcssPackageDir: string;
8
10
  shouldRewriteCssImports: boolean;
9
- runtimeLoaderPath?: string;
10
- runtimeCssImportRewriteLoaderPath?: string;
11
+ runtimeLoaderPath?: string | undefined;
12
+ registerAutoCssSource?: ((source: TailwindV4CssSource) => Promise<void> | void) | undefined;
13
+ runtimeState: TailwindRuntimeState;
11
14
  getClassSetInLoader: () => Promise<void>;
15
+ getRuntimeSetInLoader: () => Promise<Set<string>>;
16
+ markWebpackProcessedCssSource?: ((file: string) => void) | undefined;
12
17
  getRuntimeWatchDependencies: () => {
13
18
  files: ReadonlySet<string>;
14
19
  contexts: ReadonlySet<string>;
15
20
  };
21
+ runtimeRegistryKey?: string | undefined;
16
22
  debug: (format: string, ...args: unknown[]) => void;
17
23
  }
18
24
  export declare function setupWebpackV5Loaders(options: SetupWebpackV5LoadersOptions): void;
@@ -4,6 +4,7 @@ export declare const weappTailwindcssPackageDir: string;
4
4
  export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
5
5
  options: InternalUserDefinedOptions;
6
6
  appType?: AppType;
7
+ private hasInitialTailwindCssRoots;
7
8
  constructor(options?: UserDefinedOptions);
8
9
  apply(compiler: Compiler): void;
9
10
  }
@@ -0,0 +1,31 @@
1
+ import type { TailwindV4CssSource } from 'tailwindcss-patch';
2
+ import type { TailwindRuntimeState } from '../../../tailwindcss/runtime';
3
+ import type { AppType, InternalUserDefinedOptions } from '../../../types';
4
+ export interface WebpackRuntimeClassSetLoaderOptions {
5
+ getClassSet?: () => void | Promise<void>;
6
+ getWatchDependencies?: () => RuntimeLoaderWatchDependencies | Promise<RuntimeLoaderWatchDependencies | void> | void;
7
+ }
8
+ export interface RuntimeLoaderWatchDependencies {
9
+ files?: Iterable<string>;
10
+ contexts?: Iterable<string>;
11
+ }
12
+ export interface WebpackCssImportRewriteRuntimeOptions {
13
+ pkgDir: string;
14
+ appType?: AppType;
15
+ compilerOptions?: InternalUserDefinedOptions;
16
+ runtimeState?: TailwindRuntimeState;
17
+ registerCssSource?: (source: TailwindV4CssSource) => Promise<void> | void;
18
+ getRuntimeSet?: () => Promise<Set<string>> | Set<string>;
19
+ markGeneratedCssSource?: (file: string) => void;
20
+ }
21
+ export interface WebpackCssImportRewriteLoaderOptions {
22
+ tailwindcssImportRewrite?: WebpackCssImportRewriteRuntimeOptions;
23
+ tailwindcssImportRewriteRuntimeKey?: string;
24
+ }
25
+ export interface WebpackLoaderRuntimeEntry {
26
+ classSet?: WebpackRuntimeClassSetLoaderOptions;
27
+ cssImportRewrite?: WebpackCssImportRewriteRuntimeOptions;
28
+ }
29
+ export declare function setWebpackLoaderRuntime(key: string, entry: WebpackLoaderRuntimeEntry): void;
30
+ export declare function deleteWebpackLoaderRuntime(key: string): void;
31
+ export declare function getWebpackLoaderRuntime(key?: string): any;
@@ -1,11 +1,7 @@
1
1
  import type webpack from 'webpack';
2
- import type { AppType } from '../../../types';
2
+ import type { WebpackCssImportRewriteLoaderOptions } from './runtime-registry';
3
3
  import { Buffer } from 'node:buffer';
4
- interface CssImportRewriteLoaderOptions {
5
- rewriteCssImports?: {
6
- pkgDir: string;
7
- appType?: AppType;
8
- };
4
+ interface CssImportRewriteLoaderOptions extends WebpackCssImportRewriteLoaderOptions {
9
5
  }
10
6
  export declare function transformCssImportRewriteSource(source: string | Buffer, options: CssImportRewriteLoaderOptions | undefined): string | Buffer<ArrayBufferLike>;
11
7
  declare const WeappTwCssImportRewriteLoader: webpack.LoaderDefinitionFunction<CssImportRewriteLoaderOptions>;
@@ -1,11 +1,7 @@
1
1
  import type webpack from 'webpack';
2
- interface RuntimeClassSetLoaderOptions {
3
- getClassSet?: () => void | Promise<void>;
4
- getWatchDependencies?: () => RuntimeLoaderWatchDependencies | Promise<RuntimeLoaderWatchDependencies | void> | void;
5
- }
6
- interface RuntimeLoaderWatchDependencies {
7
- files?: Iterable<string>;
8
- contexts?: Iterable<string>;
2
+ import type { WebpackRuntimeClassSetLoaderOptions } from './runtime-registry';
3
+ interface RuntimeClassSetLoaderOptions extends WebpackRuntimeClassSetLoaderOptions {
4
+ weappTailwindcssRuntimeKey?: string;
9
5
  }
10
6
  declare const WeappTwRuntimeClassSetLoader: webpack.LoaderDefinitionFunction<RuntimeClassSetLoaderOptions>;
11
7
  export default WeappTwRuntimeClassSetLoader;