weapp-tailwindcss 5.0.6 → 5.0.7

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 (103) hide show
  1. package/dist/{bundle-state-CFgzVHFP.js → bundle-state-BzwPS-UI.js} +2 -1
  2. package/dist/{bundle-state-CdNXQl-o.mjs → bundle-state-ChcOKb9w.mjs} +2 -1
  3. package/dist/bundlers/gulp/index.d.ts +3 -4
  4. package/dist/bundlers/gulp/module-graph.d.ts +2 -0
  5. package/dist/bundlers/gulp/runtime-snapshot.d.ts +5 -0
  6. package/dist/bundlers/gulp/vinyl-transform.d.ts +3 -0
  7. package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
  8. package/dist/bundlers/shared/css-source-trace.d.ts +20 -0
  9. package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +11 -0
  10. package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +56 -0
  11. package/dist/bundlers/shared/generator-css/local-imports.d.ts +7 -0
  12. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -1
  13. package/dist/bundlers/shared/generator-css/types.d.ts +27 -0
  14. package/dist/bundlers/shared/generator-css/user-css.d.ts +26 -0
  15. package/dist/bundlers/shared/generator-css/validate.d.ts +5 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +4 -32
  17. package/dist/bundlers/vite/css-finalizer.d.ts +3 -0
  18. package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +2 -0
  19. package/dist/bundlers/vite/generate-bundle/css-output.d.ts +14 -0
  20. package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +11 -0
  21. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +9 -0
  22. package/dist/bundlers/vite/generate-bundle/style-matching.d.ts +5 -0
  23. package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +7 -0
  24. package/dist/bundlers/vite/generate-bundle/types.d.ts +68 -0
  25. package/dist/bundlers/vite/generate-bundle.d.ts +4 -62
  26. package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +4 -0
  27. package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +2 -0
  28. package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +13 -0
  29. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +1 -0
  30. package/dist/bundlers/vite/processed-css-assets/css-rules.d.ts +17 -0
  31. package/dist/bundlers/vite/processed-css-assets.d.ts +2 -0
  32. package/dist/bundlers/vite/source-candidates/scan-root.d.ts +10 -0
  33. package/dist/bundlers/vite/source-candidates/script.d.ts +7 -0
  34. package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +1 -0
  35. package/dist/bundlers/vite/source-candidates.d.ts +8 -3
  36. package/dist/bundlers/vite/source-scan/css-entries.d.ts +20 -0
  37. package/dist/bundlers/vite/source-scan/dependencies.d.ts +2 -0
  38. package/dist/bundlers/vite/source-scan.d.ts +2 -12
  39. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -0
  40. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -20
  41. package/dist/cli.js +69 -69
  42. package/dist/cli.mjs +69 -69
  43. package/dist/core.js +1 -1
  44. package/dist/core.mjs +1 -1
  45. package/dist/{defaults-BPUuNYcD.js → defaults-Boc26eel.js} +1 -0
  46. package/dist/{defaults-8xrgzxFY.mjs → defaults-DH0ZQRhy.mjs} +1 -0
  47. package/dist/defaults.js +1 -1
  48. package/dist/defaults.mjs +1 -1
  49. package/dist/{generator-C56PJYxA.js → generator-6yF8wjxR.js} +1 -1
  50. package/dist/{generator-Bgn4m8An.mjs → generator-BON6M1bL.mjs} +1 -1
  51. package/dist/generator.js +2 -2
  52. package/dist/generator.mjs +2 -2
  53. package/dist/gulp-_7p1Z2vc.js +473 -0
  54. package/dist/gulp-oE-Byqk6.mjs +463 -0
  55. package/dist/gulp.js +4 -414
  56. package/dist/gulp.mjs +1 -406
  57. package/dist/{incremental-runtime-class-set-Bmzdjlk0.js → hmr-timing-BKQNRxHr.js} +1205 -449
  58. package/dist/{incremental-runtime-class-set-BEYHQkZc.mjs → hmr-timing-BVTGf5ch.mjs} +1169 -467
  59. package/dist/index.js +5 -5
  60. package/dist/index.mjs +5 -5
  61. package/dist/{postcss-B7QNe78h.js → postcss-BTIunhWl.js} +7 -7
  62. package/dist/{postcss-BgINK7Nm.mjs → postcss-BtmrrZ31.mjs} +4 -4
  63. package/dist/postcss.js +1 -1
  64. package/dist/postcss.mjs +1 -1
  65. package/dist/{precheck-Copn2SqE.mjs → precheck-CZjr87m_.mjs} +19 -5
  66. package/dist/{precheck-CyPbGn38.js → precheck-fhIkzCSU.js} +19 -5
  67. package/dist/presets.js +2 -2
  68. package/dist/presets.mjs +2 -2
  69. package/dist/tailwindcss/source-scan/inline-source.d.ts +7 -0
  70. package/dist/tailwindcss/source-scan.d.ts +2 -7
  71. package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +3 -0
  72. package/dist/tailwindcss/v3-engine/generator/content.d.ts +10 -0
  73. package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +2 -0
  74. package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +2 -0
  75. package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +6 -0
  76. package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -0
  77. package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
  78. package/dist/{tailwindcss-C0Zgo3Es.mjs → tailwindcss-bbQUg25J.mjs} +2 -2
  79. package/dist/{tailwindcss-Tw6CSVHL.js → tailwindcss-vswd1gc3.js} +2 -2
  80. package/dist/{transform-95ivJthq.js → transform-CReJxxh_.js} +11 -2
  81. package/dist/{transform-DgCFGtQR.mjs → transform-DEsFlG9k.mjs} +11 -2
  82. package/dist/types/typedoc-tailwindcss-patch.d.ts +4 -2
  83. package/dist/types/user-defined-options/general.d.ts +5 -0
  84. package/dist/uni-app-x/component-local-style.d.ts +1 -0
  85. package/dist/uni-app-x/harmony.d.ts +1 -0
  86. package/dist/uni-app-x/style-asset/style-value.d.ts +16 -0
  87. package/dist/uni-app-x/style-asset.d.ts +20 -0
  88. package/dist/uni-app-x/transform.d.ts +1 -0
  89. package/dist/uni-app-x/vite.d.ts +1 -0
  90. package/dist/{v3-engine-6FVAcrZl.js → v3-engine-CEMXFegG.js} +758 -708
  91. package/dist/{v3-engine-Ji6AXPh2.mjs → v3-engine-CdIwmHuc.mjs} +756 -706
  92. package/dist/{vite-Bw6LOXvf.js → vite-0jFbh9hx.js} +1797 -386
  93. package/dist/{vite-ChZ2cbn4.mjs → vite-C7BGAlCE.mjs} +1779 -369
  94. package/dist/vite.js +1 -1
  95. package/dist/vite.mjs +1 -1
  96. package/dist/weapp-tw-css-import-rewrite-loader.js +1104 -980
  97. package/dist/{webpack-CMJ7iqN7.mjs → webpack-Dx6_eg5k.mjs} +96 -36
  98. package/dist/{webpack-nn3P8_S_.js → webpack-aEuDoYfQ.js} +105 -44
  99. package/dist/webpack.js +1 -1
  100. package/dist/webpack.mjs +1 -1
  101. package/package.json +7 -6
  102. package/dist/source-candidates-BODCmzz5.mjs +0 -355
  103. package/dist/source-candidates-Caf2GDvx.js +0 -374
@@ -1,5 +1,6 @@
1
1
  import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
2
  import type { IArbitraryValues } from '../../types/shared';
3
+ export { createTailwindV3DefaultExtractor } from './source-candidates/tailwind-v3-default-extractor';
3
4
  export interface SourceCandidateCollector {
4
5
  sync: (id: string, source: string) => Promise<void>;
5
6
  syncCss: (id: string, source: string) => Promise<void>;
@@ -9,8 +10,10 @@ export interface SourceCandidateCollector {
9
10
  scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
10
11
  syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
11
12
  remove: (id: string) => void;
13
+ source: (id: string) => string | undefined;
12
14
  values: () => Set<string>;
13
- valuesForEntries: (entries: TailwindSourceEntry[] | undefined) => Set<string>;
15
+ valuesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>;
16
+ sourcesForEntries: (entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>;
14
17
  snapshot: () => SourceCandidateCollectorSnapshot;
15
18
  restore: (snapshot: SourceCandidateCollectorSnapshot) => void;
16
19
  clear: () => void;
@@ -19,10 +22,14 @@ export interface SourceCandidateCollectorSnapshot {
19
22
  candidatesById: Array<[string, string[]]>;
20
23
  cssCandidatesById?: Array<[string, string[]]> | undefined;
21
24
  scanCandidatesById?: Array<[string, string[]]> | undefined;
25
+ sourceById?: Array<[string, string]> | undefined;
22
26
  transformCandidatesById?: Array<[string, string[]]> | undefined;
23
27
  inlineExcludedCandidates: string[];
24
28
  inlineIncludedCandidates: string[];
25
29
  }
30
+ export interface SourceCandidateFilterOptions {
31
+ excludeEntries?: TailwindSourceEntry[] | undefined;
32
+ }
26
33
  interface ScanSourceCandidateRootOptions {
27
34
  root: string;
28
35
  outDir?: string | undefined;
@@ -33,7 +40,5 @@ export interface SourceCandidateCollectorOptions {
33
40
  bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined;
34
41
  extractor?: ((source: string, extension: string) => Promise<Iterable<string>> | Iterable<string>) | undefined;
35
42
  }
36
- export declare function createTailwindV3DefaultExtractor(): ((source: string) => Set<string>) | undefined;
37
43
  export declare function isSourceCandidateRequest(id: string): boolean;
38
44
  export declare function createSourceCandidateCollector(options?: SourceCandidateCollectorOptions): SourceCandidateCollector;
39
- export {};
@@ -0,0 +1,20 @@
1
+ import type { TailwindV4CssSource } from 'tailwindcss-patch';
2
+ import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../../tailwindcss/source-scan';
3
+ import type { TailwindcssPatcherLike, UserDefinedOptions } from '../../../types';
4
+ export interface ResolvedTailwindV4CssEntries {
5
+ entries: TailwindSourceEntry[];
6
+ explicit: boolean;
7
+ inlineCandidates: TailwindInlineSourceCandidates;
8
+ dependencies: string[];
9
+ }
10
+ export declare function mergeTailwindInlineSourceCandidates(allInlineCandidates: Array<TailwindInlineSourceCandidates | undefined>): TailwindInlineSourceCandidates | undefined;
11
+ export declare function resolveTailwindV4EntriesFromCss(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
12
+ export declare function resolveViteTailwindV4CssDependencies(css: string, base: string): Promise<string[]>;
13
+ export declare function collectExistingCssEntries(options: UserDefinedOptions): string[];
14
+ export declare function resolveTailwindV3CssEntryScan(options: UserDefinedOptions, patcher: TailwindcssPatcherLike): Promise<{
15
+ entries: TailwindSourceEntry[];
16
+ dependencies: Set<string>;
17
+ }>;
18
+ export declare function resolveTailwindV4EntriesFromCssCached(css: string, base: string): Promise<ResolvedTailwindV4CssEntries | undefined>;
19
+ export declare function discoverTailwindV4CssEntries(root: string, outDir: string | undefined): Promise<string[]>;
20
+ export declare function collectConfiguredCssSources(options: UserDefinedOptions): TailwindV4CssSource[];
@@ -0,0 +1,2 @@
1
+ export declare function addSourceScanDependency(dependencies: Set<string>, file: string | undefined): void;
2
+ export declare function addSourceScanDependencies(dependencies: Set<string>, files: string[] | undefined): void;
@@ -1,11 +1,7 @@
1
1
  import type { TailwindInlineSourceCandidates, TailwindSourceEntry } from '../../tailwindcss/source-scan';
2
2
  import type { TailwindcssPatcherLike, UserDefinedOptions } from '../../types';
3
- export interface ResolvedTailwindV4CssEntries {
4
- entries: TailwindSourceEntry[];
5
- explicit: boolean;
6
- inlineCandidates: TailwindInlineSourceCandidates;
7
- dependencies: string[];
8
- }
3
+ export { discoverTailwindV4CssEntries, resolveTailwindV4EntriesFromCss, resolveTailwindV4EntriesFromCssCached, resolveViteTailwindV4CssDependencies, } from './source-scan/css-entries';
4
+ export type { ResolvedTailwindV4CssEntries } from './source-scan/css-entries';
9
5
  export interface ResolvedViteSourceScan {
10
6
  dependencies?: string[] | undefined;
11
7
  entries?: TailwindSourceEntry[] | undefined;
@@ -16,11 +12,5 @@ interface ResolveViteSourceScanOptions {
16
12
  root?: string | undefined;
17
13
  outDir?: string | undefined;
18
14
  }
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
15
  export declare function resolveViteSourceScanEntries(options: UserDefinedOptions, patcher: TailwindcssPatcherLike, scanOptions?: ResolveViteSourceScanOptions): Promise<ResolvedViteSourceScan | undefined>;
25
16
  export declare function createViteSourceScanMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
26
- export {};
@@ -0,0 +1,48 @@
1
+ import type { Compiler, sources as WebpackSources } from 'webpack';
2
+ import type { BundleRuntimeClassSetManager } from '../../../vite/incremental-runtime-class-set';
3
+ import type { AppType, InternalUserDefinedOptions } from '../../../../types';
4
+ export interface SetupWebpackV5ProcessAssetsHookOptions {
5
+ compiler: Compiler;
6
+ options: InternalUserDefinedOptions;
7
+ appType?: AppType | undefined;
8
+ runtimeState: {
9
+ twPatcher: InternalUserDefinedOptions['twPatcher'];
10
+ readyPromise: Promise<void>;
11
+ };
12
+ getRuntimeRefreshRequirement: () => boolean;
13
+ refreshRuntimeMetadata: (force: boolean) => Promise<void>;
14
+ isWebpackProcessedCssAsset?: ((file: string, rawSource: string) => boolean) | undefined;
15
+ consumeRuntimeRefreshRequirement: () => void;
16
+ isWatchMode?: (() => boolean) | undefined;
17
+ runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
18
+ debug: (format: string, ...args: unknown[]) => void;
19
+ }
20
+ export type WebpackSourceLike = string | WebpackSources.Source;
21
+ export declare function createWebpackSnapshotAssets(assets: Record<string, {
22
+ source: () => unknown;
23
+ }>): {
24
+ [k: string]: {
25
+ fileName: string;
26
+ source: string;
27
+ type: string;
28
+ };
29
+ };
30
+ export declare function stringifyWebpackSource(source: unknown): string;
31
+ export declare function createWebpackAssetUpdater(options: {
32
+ compilation: {
33
+ getAsset: (file: string) => {
34
+ source: {
35
+ source: () => unknown;
36
+ };
37
+ } | undefined;
38
+ updateAsset: (file: string, source: WebpackSourceLike) => void;
39
+ };
40
+ ConcatSource: new (source: string) => WebpackSources.Source;
41
+ onUpdate: (file: string, previousSource: string, nextSource: string) => void;
42
+ debug: (format: string, ...args: unknown[]) => void;
43
+ }): {
44
+ getCurrentAssetSource: (file: string) => string | undefined;
45
+ updateAssetIfChanged: (file: string, source: WebpackSourceLike, { notifyUpdate }?: {
46
+ notifyUpdate?: boolean;
47
+ }) => boolean;
48
+ };
@@ -1,21 +1,2 @@
1
- import type { Compiler } from 'webpack';
2
- import type { BundleRuntimeClassSetManager } from '../../vite/incremental-runtime-class-set';
3
- import type { AppType, InternalUserDefinedOptions } from '../../../types';
4
- interface SetupWebpackV5ProcessAssetsHookOptions {
5
- compiler: Compiler;
6
- options: InternalUserDefinedOptions;
7
- appType?: AppType | undefined;
8
- runtimeState: {
9
- twPatcher: InternalUserDefinedOptions['twPatcher'];
10
- readyPromise: Promise<void>;
11
- };
12
- getRuntimeRefreshRequirement: () => boolean;
13
- refreshRuntimeMetadata: (force: boolean) => Promise<void>;
14
- isWebpackProcessedCssAsset?: ((file: string, rawSource: string) => boolean) | undefined;
15
- consumeRuntimeRefreshRequirement: () => void;
16
- isWatchMode?: (() => boolean) | undefined;
17
- runtimeClassSetManager?: BundleRuntimeClassSetManager | undefined;
18
- debug: (format: string, ...args: unknown[]) => void;
19
- }
1
+ import type { SetupWebpackV5ProcessAssetsHookOptions } from './v5-assets/helpers';
20
2
  export declare function setupWebpackV5ProcessAssetsHook(options: SetupWebpackV5ProcessAssetsHookOptions): void;
21
- export {};
package/dist/cli.js CHANGED
@@ -41,8 +41,8 @@ require("postcss");
41
41
  require("micromatch");
42
42
  let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
43
43
  let node_module = require("node:module");
44
- require("fast-glob");
45
44
  require("tailwindcss-config");
45
+ require("fast-glob");
46
46
  let _babel_traverse = require("@babel/traverse");
47
47
  _babel_traverse = __toESM(_babel_traverse);
48
48
  let _babel_parser = require("@babel/parser");
@@ -227,68 +227,6 @@ const creator = () => {
227
227
  };
228
228
  creator.postcss = true;
229
229
  //#endregion
230
- //#region src/tailwindcss/source-scan.ts
231
- const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
232
- "html",
233
- "wxml",
234
- "axml",
235
- "jxml",
236
- "ksml",
237
- "ttml",
238
- "qml",
239
- "tyml",
240
- "xhsml",
241
- "swan",
242
- "vue",
243
- "mpx",
244
- "js",
245
- "jsx",
246
- "ts",
247
- "tsx"
248
- ];
249
- const FULL_SOURCE_SCAN_EXTENSIONS = [
250
- "js",
251
- "jsx",
252
- "mjs",
253
- "cjs",
254
- "ts",
255
- "tsx",
256
- "mts",
257
- "cts",
258
- "vue",
259
- "uvue",
260
- "nvue",
261
- "svelte",
262
- "mpx",
263
- "html",
264
- "wxml",
265
- "axml",
266
- "jxml",
267
- "ksml",
268
- "ttml",
269
- "qml",
270
- "tyml",
271
- "xhsml",
272
- "swan",
273
- "css",
274
- "wxss",
275
- "acss",
276
- "jxss",
277
- "ttss",
278
- "qss",
279
- "tyss",
280
- "scss",
281
- "sass",
282
- "less",
283
- "styl",
284
- "stylus"
285
- ];
286
- function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
287
- return `**/*.{${extensions.join(",")}}`;
288
- }
289
- createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
290
- new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
291
- //#endregion
292
230
  //#region src/utils/object.ts
293
231
  function definedEntries(value) {
294
232
  return Object.entries(value).filter(([, item]) => item !== void 0);
@@ -296,12 +234,6 @@ function definedEntries(value) {
296
234
  function omitUndefined(value) {
297
235
  return Object.fromEntries(definedEntries(value));
298
236
  }
299
- (0, _weapp_tailwindcss_postcss.createStyleHandler)({
300
- cssChildCombinatorReplaceValue: ["view", "text"],
301
- cssRemoveHoverPseudoClass: true,
302
- isMainChunk: true,
303
- majorVersion: 4
304
- });
305
237
  //#endregion
306
238
  //#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
307
239
  const TAILWIND_V3_COLOR_STEPS = [
@@ -664,6 +596,74 @@ function createTailwindV3DefaultColorThemeCss() {
664
596
  " margin: auto;",
665
597
  "}"
666
598
  ].join("\n");
599
+ //#endregion
600
+ //#region src/tailwindcss/source-scan.ts
601
+ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
602
+ "html",
603
+ "wxml",
604
+ "axml",
605
+ "jxml",
606
+ "ksml",
607
+ "ttml",
608
+ "qml",
609
+ "tyml",
610
+ "xhsml",
611
+ "swan",
612
+ "vue",
613
+ "mpx",
614
+ "js",
615
+ "jsx",
616
+ "ts",
617
+ "tsx"
618
+ ];
619
+ const FULL_SOURCE_SCAN_EXTENSIONS = [
620
+ "js",
621
+ "jsx",
622
+ "mjs",
623
+ "cjs",
624
+ "ts",
625
+ "tsx",
626
+ "mts",
627
+ "cts",
628
+ "vue",
629
+ "uvue",
630
+ "nvue",
631
+ "svelte",
632
+ "mpx",
633
+ "html",
634
+ "wxml",
635
+ "axml",
636
+ "jxml",
637
+ "ksml",
638
+ "ttml",
639
+ "qml",
640
+ "tyml",
641
+ "xhsml",
642
+ "swan",
643
+ "css",
644
+ "wxss",
645
+ "acss",
646
+ "jxss",
647
+ "ttss",
648
+ "qss",
649
+ "tyss",
650
+ "scss",
651
+ "sass",
652
+ "less",
653
+ "styl",
654
+ "stylus"
655
+ ];
656
+ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
657
+ return `**/*.{${extensions.join(",")}}`;
658
+ }
659
+ createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
660
+ new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
661
+ (0, _weapp_tailwindcss_postcss.createStyleHandler)({
662
+ cssChildCombinatorReplaceValue: ["view", "text"],
663
+ cssRemoveHoverPseudoClass: true,
664
+ isMainChunk: true,
665
+ majorVersion: 4
666
+ });
667
667
  (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
668
668
  (0, _weapp_tailwindcss_postcss.createStyleHandler)({
669
669
  cssChildCombinatorReplaceValue: ["view", "text"],
package/dist/cli.mjs CHANGED
@@ -14,8 +14,8 @@ import { constants, existsSync, readFileSync } from "node:fs";
14
14
  import "postcss";
15
15
  import "micromatch";
16
16
  import { createStyleHandler } from "@weapp-tailwindcss/postcss";
17
- import "fast-glob";
18
17
  import "tailwindcss-config";
18
+ import "fast-glob";
19
19
  import _babelTraverse from "@babel/traverse";
20
20
  import { parse } from "@babel/parser";
21
21
  import MagicString from "magic-string";
@@ -198,68 +198,6 @@ const creator = () => {
198
198
  };
199
199
  creator.postcss = true;
200
200
  //#endregion
201
- //#region src/tailwindcss/source-scan.ts
202
- const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
203
- "html",
204
- "wxml",
205
- "axml",
206
- "jxml",
207
- "ksml",
208
- "ttml",
209
- "qml",
210
- "tyml",
211
- "xhsml",
212
- "swan",
213
- "vue",
214
- "mpx",
215
- "js",
216
- "jsx",
217
- "ts",
218
- "tsx"
219
- ];
220
- const FULL_SOURCE_SCAN_EXTENSIONS = [
221
- "js",
222
- "jsx",
223
- "mjs",
224
- "cjs",
225
- "ts",
226
- "tsx",
227
- "mts",
228
- "cts",
229
- "vue",
230
- "uvue",
231
- "nvue",
232
- "svelte",
233
- "mpx",
234
- "html",
235
- "wxml",
236
- "axml",
237
- "jxml",
238
- "ksml",
239
- "ttml",
240
- "qml",
241
- "tyml",
242
- "xhsml",
243
- "swan",
244
- "css",
245
- "wxss",
246
- "acss",
247
- "jxss",
248
- "ttss",
249
- "qss",
250
- "tyss",
251
- "scss",
252
- "sass",
253
- "less",
254
- "styl",
255
- "stylus"
256
- ];
257
- function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
258
- return `**/*.{${extensions.join(",")}}`;
259
- }
260
- createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
261
- new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
262
- //#endregion
263
201
  //#region src/utils/object.ts
264
202
  function definedEntries(value) {
265
203
  return Object.entries(value).filter(([, item]) => item !== void 0);
@@ -267,12 +205,6 @@ function definedEntries(value) {
267
205
  function omitUndefined(value) {
268
206
  return Object.fromEntries(definedEntries(value));
269
207
  }
270
- createStyleHandler({
271
- cssChildCombinatorReplaceValue: ["view", "text"],
272
- cssRemoveHoverPseudoClass: true,
273
- isMainChunk: true,
274
- majorVersion: 4
275
- });
276
208
  //#endregion
277
209
  //#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
278
210
  const TAILWIND_V3_COLOR_STEPS = [
@@ -635,6 +567,74 @@ function createTailwindV3DefaultColorThemeCss() {
635
567
  " margin: auto;",
636
568
  "}"
637
569
  ].join("\n");
570
+ //#endregion
571
+ //#region src/tailwindcss/source-scan.ts
572
+ const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
573
+ "html",
574
+ "wxml",
575
+ "axml",
576
+ "jxml",
577
+ "ksml",
578
+ "ttml",
579
+ "qml",
580
+ "tyml",
581
+ "xhsml",
582
+ "swan",
583
+ "vue",
584
+ "mpx",
585
+ "js",
586
+ "jsx",
587
+ "ts",
588
+ "tsx"
589
+ ];
590
+ const FULL_SOURCE_SCAN_EXTENSIONS = [
591
+ "js",
592
+ "jsx",
593
+ "mjs",
594
+ "cjs",
595
+ "ts",
596
+ "tsx",
597
+ "mts",
598
+ "cts",
599
+ "vue",
600
+ "uvue",
601
+ "nvue",
602
+ "svelte",
603
+ "mpx",
604
+ "html",
605
+ "wxml",
606
+ "axml",
607
+ "jxml",
608
+ "ksml",
609
+ "ttml",
610
+ "qml",
611
+ "tyml",
612
+ "xhsml",
613
+ "swan",
614
+ "css",
615
+ "wxss",
616
+ "acss",
617
+ "jxss",
618
+ "ttss",
619
+ "qss",
620
+ "tyss",
621
+ "scss",
622
+ "sass",
623
+ "less",
624
+ "styl",
625
+ "stylus"
626
+ ];
627
+ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
628
+ return `**/*.{${extensions.join(",")}}`;
629
+ }
630
+ createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
631
+ new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
632
+ createStyleHandler({
633
+ cssChildCombinatorReplaceValue: ["view", "text"],
634
+ cssRemoveHoverPseudoClass: true,
635
+ isMainChunk: true,
636
+ majorVersion: 4
637
+ });
638
638
  createRequire(import.meta.url);
639
639
  createStyleHandler({
640
640
  cssChildCombinatorReplaceValue: ["view", "text"],
package/dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_precheck = require("./precheck-CyPbGn38.js");
2
+ const require_precheck = require("./precheck-fhIkzCSU.js");
3
3
  let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
4
4
  //#region src/core.ts
5
5
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
package/dist/core.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as getCompilerContext, t as shouldSkipJsTransform, v as createTailwindRuntimeReadyPromise, y as ensureRuntimeClassSet } from "./precheck-Copn2SqE.mjs";
1
+ import { n as getCompilerContext, t as shouldSkipJsTransform, v as createTailwindRuntimeReadyPromise, y as ensureRuntimeClassSet } from "./precheck-CZjr87m_.mjs";
2
2
  import { defuOverrideArray } from "@weapp-tailwindcss/shared";
3
3
  //#region src/core.ts
4
4
  const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
@@ -142,6 +142,7 @@ function getDefaultOptions() {
142
142
  ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
143
143
  replaceRuntimePackages: false,
144
144
  generator: {},
145
+ cssSourceTrace: false,
145
146
  tailwindcssPatcherOptions: { filter(className) {
146
147
  return !(0, _weapp_core_escape.isAllowedClassName)(className);
147
148
  } },
@@ -141,6 +141,7 @@ function getDefaultOptions() {
141
141
  ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
142
142
  replaceRuntimePackages: false,
143
143
  generator: {},
144
+ cssSourceTrace: false,
144
145
  tailwindcssPatcherOptions: { filter(className) {
145
146
  return !isAllowedClassName(className);
146
147
  } },
package/dist/defaults.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_defaults = require("./defaults-BPUuNYcD.js");
2
+ const require_defaults = require("./defaults-Boc26eel.js");
3
3
  exports.TAILWIND_V3_CSS_PREFLIGHT = require_defaults.TAILWIND_V3_CSS_PREFLIGHT;
4
4
  exports.TAILWIND_V4_CSS_PREFLIGHT = require_defaults.TAILWIND_V4_CSS_PREFLIGHT;
5
5
  exports.getDefaultCssPreflight = require_defaults.getDefaultCssPreflight;
package/dist/defaults.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as resolveDefaultCssPreflight, i as getDefaultOptions, n as TAILWIND_V4_CSS_PREFLIGHT, r as getDefaultCssPreflight, t as TAILWIND_V3_CSS_PREFLIGHT } from "./defaults-8xrgzxFY.mjs";
1
+ import { a as resolveDefaultCssPreflight, i as getDefaultOptions, n as TAILWIND_V4_CSS_PREFLIGHT, r as getDefaultCssPreflight, t as TAILWIND_V3_CSS_PREFLIGHT } from "./defaults-DH0ZQRhy.mjs";
2
2
  export { TAILWIND_V3_CSS_PREFLIGHT, TAILWIND_V4_CSS_PREFLIGHT, getDefaultCssPreflight, getDefaultOptions, resolveDefaultCssPreflight };
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
2
+ const require_v3_engine = require("./v3-engine-CEMXFegG.js");
3
3
  let node_process = require("node:process");
4
4
  node_process = require_chunk.__toESM(node_process);
5
5
  //#region src/generator/options.ts
@@ -1,4 +1,4 @@
1
- import { K as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-Ji6AXPh2.mjs";
1
+ import { K as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-CdIwmHuc.mjs";
2
2
  import process from "node:process";
3
3
  //#region src/generator/options.ts
4
4
  const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
package/dist/generator.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
3
- const require_generator = require("./generator-C56PJYxA.js");
2
+ const require_v3_engine = require("./v3-engine-CEMXFegG.js");
3
+ const require_generator = require("./generator-6yF8wjxR.js");
4
4
  let tailwindcss_patch = require("tailwindcss-patch");
5
5
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
6
6
  exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
@@ -1,3 +1,3 @@
1
- import { J as transformTailwindV4CssToWeapp, S as resolveTailwindV4SourceOptionsFromPatcher, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, q as transformTailwindV4CssByTarget, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-Ji6AXPh2.mjs";
2
- import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-Bgn4m8An.mjs";
1
+ import { J as transformTailwindV4CssToWeapp, S as resolveTailwindV4SourceOptionsFromPatcher, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, q as transformTailwindV4CssByTarget, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-CdIwmHuc.mjs";
2
+ import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-BON6M1bL.mjs";
3
3
  export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };