weapp-tailwindcss 5.0.0-next.17 → 5.0.0-next.18
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.
- package/dist/{bundle-state-DDgxuERW.js → bundle-state-Cmi0kFpJ.js} +1 -1
- package/dist/{bundle-state-YW-zLcsc.mjs → bundle-state-DsgThPdW.mjs} +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +1 -0
- package/dist/cli.js +63 -61
- package/dist/cli.mjs +63 -61
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-BIEhxFdv.js → generator-CQ8A3YVm.js} +1 -1
- package/dist/{generator-Ber8UVgv.mjs → generator-CbjnpVed.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-CfznDtJ0.js → incremental-runtime-class-set-BMo8s7do.js} +54 -21
- package/dist/{incremental-runtime-class-set-DC0RsBbK.mjs → incremental-runtime-class-set-Cwq1Wbo2.mjs} +52 -19
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-DW08tZXt.mjs → postcss-CLQ3yVXP.mjs} +3 -20
- package/dist/{postcss-DCOUtuwI.js → postcss-CXJLLWRe.js} +3 -20
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-CX-5VqM1.mjs → precheck-Bbcmh24Z.mjs} +2 -2
- package/dist/{precheck-CZfnh4T6.js → precheck-CTRQCNuH.js} +2 -2
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/{source-candidates-DGlDzkvf.mjs → source-candidates-B3NL91dO.mjs} +23 -73
- package/dist/{source-candidates-BDyoPviV.js → source-candidates-CVp7TQFL.js} +23 -75
- package/dist/tailwindcss/source-scan.d.ts +10 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +3 -0
- package/dist/{tailwindcss-BVoa7vx-.js → tailwindcss-DO30H8ux.js} +1 -1
- package/dist/{tailwindcss-D74Wk4ys.mjs → tailwindcss-P0OQvEif.mjs} +1 -1
- package/dist/{v3-engine-CCxDqZ8e.mjs → v3-engine-DHsPM4ye.mjs} +176 -149
- package/dist/{v3-engine-BRInt2DS.js → v3-engine-DpaX1FqH.js} +209 -146
- package/dist/{vite-DnHdmHHD.js → vite-DglfodCp.js} +9 -9
- package/dist/{vite-bmU2kkO6.mjs → vite-oKeO_p82.mjs} +9 -9
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/{webpack-BkBoEn4k.mjs → webpack-BaqqyfEd.mjs} +5 -5
- package/dist/{webpack-SxEdWHlL.js → webpack-De6UzFP9.js} +5 -5
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_precheck = require("./precheck-CTRQCNuH.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_chunk.__toESM(node_path);
|
|
@@ -3,6 +3,7 @@ export interface SourceCandidateCollector {
|
|
|
3
3
|
sync: (id: string, source: string) => Promise<void>;
|
|
4
4
|
merge: (id: string, source: string) => Promise<void>;
|
|
5
5
|
syncFile: (id: string) => Promise<void>;
|
|
6
|
+
syncCurrentFile: (id: string) => Promise<void>;
|
|
6
7
|
scanRoot: (options: ScanSourceCandidateRootOptions) => Promise<void>;
|
|
7
8
|
syncInline: (inlineCandidates: TailwindInlineSourceCandidates | undefined) => void;
|
|
8
9
|
remove: (id: string) => void;
|
package/dist/cli.js
CHANGED
|
@@ -38,10 +38,10 @@ debug = __toESM(debug);
|
|
|
38
38
|
let node_fs = require("node:fs");
|
|
39
39
|
node_fs = __toESM(node_fs);
|
|
40
40
|
require("postcss");
|
|
41
|
+
require("micromatch");
|
|
41
42
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
42
43
|
let node_module = require("node:module");
|
|
43
44
|
require("fast-glob");
|
|
44
|
-
require("micromatch");
|
|
45
45
|
require("tailwindcss-config");
|
|
46
46
|
let _babel_traverse = require("@babel/traverse");
|
|
47
47
|
_babel_traverse = __toESM(_babel_traverse);
|
|
@@ -73,6 +73,68 @@ function createDebug(prefix) {
|
|
|
73
73
|
return debug$4;
|
|
74
74
|
}
|
|
75
75
|
//#endregion
|
|
76
|
+
//#region src/tailwindcss/source-scan.ts
|
|
77
|
+
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
78
|
+
"html",
|
|
79
|
+
"wxml",
|
|
80
|
+
"axml",
|
|
81
|
+
"jxml",
|
|
82
|
+
"ksml",
|
|
83
|
+
"ttml",
|
|
84
|
+
"qml",
|
|
85
|
+
"tyml",
|
|
86
|
+
"xhsml",
|
|
87
|
+
"swan",
|
|
88
|
+
"vue",
|
|
89
|
+
"mpx",
|
|
90
|
+
"js",
|
|
91
|
+
"jsx",
|
|
92
|
+
"ts",
|
|
93
|
+
"tsx"
|
|
94
|
+
];
|
|
95
|
+
const FULL_SOURCE_SCAN_EXTENSIONS = [
|
|
96
|
+
"js",
|
|
97
|
+
"jsx",
|
|
98
|
+
"mjs",
|
|
99
|
+
"cjs",
|
|
100
|
+
"ts",
|
|
101
|
+
"tsx",
|
|
102
|
+
"mts",
|
|
103
|
+
"cts",
|
|
104
|
+
"vue",
|
|
105
|
+
"uvue",
|
|
106
|
+
"nvue",
|
|
107
|
+
"svelte",
|
|
108
|
+
"mpx",
|
|
109
|
+
"html",
|
|
110
|
+
"wxml",
|
|
111
|
+
"axml",
|
|
112
|
+
"jxml",
|
|
113
|
+
"ksml",
|
|
114
|
+
"ttml",
|
|
115
|
+
"qml",
|
|
116
|
+
"tyml",
|
|
117
|
+
"xhsml",
|
|
118
|
+
"swan",
|
|
119
|
+
"css",
|
|
120
|
+
"wxss",
|
|
121
|
+
"acss",
|
|
122
|
+
"jxss",
|
|
123
|
+
"ttss",
|
|
124
|
+
"qss",
|
|
125
|
+
"tyss",
|
|
126
|
+
"scss",
|
|
127
|
+
"sass",
|
|
128
|
+
"less",
|
|
129
|
+
"styl",
|
|
130
|
+
"stylus"
|
|
131
|
+
];
|
|
132
|
+
function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
133
|
+
return `**/*.{${extensions.join(",")}}`;
|
|
134
|
+
}
|
|
135
|
+
createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
|
|
136
|
+
new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
|
|
137
|
+
//#endregion
|
|
76
138
|
//#region src/utils/object.ts
|
|
77
139
|
function definedEntries(value) {
|
|
78
140
|
return Object.entries(value).filter(([, item]) => item !== void 0);
|
|
@@ -448,29 +510,6 @@ function createTailwindV3DefaultColorThemeCss() {
|
|
|
448
510
|
" margin: auto;",
|
|
449
511
|
"}"
|
|
450
512
|
].join("\n");
|
|
451
|
-
//#endregion
|
|
452
|
-
//#region src/tailwindcss/source-scan.ts
|
|
453
|
-
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
454
|
-
"html",
|
|
455
|
-
"wxml",
|
|
456
|
-
"axml",
|
|
457
|
-
"jxml",
|
|
458
|
-
"ksml",
|
|
459
|
-
"ttml",
|
|
460
|
-
"qml",
|
|
461
|
-
"tyml",
|
|
462
|
-
"xhsml",
|
|
463
|
-
"swan",
|
|
464
|
-
"vue",
|
|
465
|
-
"mpx",
|
|
466
|
-
"js",
|
|
467
|
-
"jsx",
|
|
468
|
-
"ts",
|
|
469
|
-
"tsx"
|
|
470
|
-
];
|
|
471
|
-
function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
472
|
-
return `**/*.{${extensions.join(",")}}`;
|
|
473
|
-
}
|
|
474
513
|
(0, _weapp_tailwindcss_postcss.createStyleHandler)({
|
|
475
514
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
476
515
|
cssRemoveHoverPseudoClass: true,
|
|
@@ -482,43 +521,6 @@ function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
|
482
521
|
"@tailwind components;",
|
|
483
522
|
"@tailwind utilities;"
|
|
484
523
|
].join("\n");
|
|
485
|
-
createSourceScanPattern([
|
|
486
|
-
"js",
|
|
487
|
-
"jsx",
|
|
488
|
-
"mjs",
|
|
489
|
-
"cjs",
|
|
490
|
-
"ts",
|
|
491
|
-
"tsx",
|
|
492
|
-
"mts",
|
|
493
|
-
"cts",
|
|
494
|
-
"vue",
|
|
495
|
-
"uvue",
|
|
496
|
-
"nvue",
|
|
497
|
-
"svelte",
|
|
498
|
-
"mpx",
|
|
499
|
-
"html",
|
|
500
|
-
"wxml",
|
|
501
|
-
"axml",
|
|
502
|
-
"jxml",
|
|
503
|
-
"ksml",
|
|
504
|
-
"ttml",
|
|
505
|
-
"qml",
|
|
506
|
-
"tyml",
|
|
507
|
-
"xhsml",
|
|
508
|
-
"swan",
|
|
509
|
-
"css",
|
|
510
|
-
"wxss",
|
|
511
|
-
"acss",
|
|
512
|
-
"jxss",
|
|
513
|
-
"ttss",
|
|
514
|
-
"qss",
|
|
515
|
-
"tyss",
|
|
516
|
-
"scss",
|
|
517
|
-
"sass",
|
|
518
|
-
"less",
|
|
519
|
-
"styl",
|
|
520
|
-
"stylus"
|
|
521
|
-
]);
|
|
522
524
|
createDebug("[tailwindcss:runtime-patch] ");
|
|
523
525
|
(0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
524
526
|
createDebug("[tailwindcss:runtime] ");
|
package/dist/cli.mjs
CHANGED
|
@@ -12,9 +12,9 @@ import "@weapp-tailwindcss/shared";
|
|
|
12
12
|
import _createDebug from "debug";
|
|
13
13
|
import { constants, existsSync, readFileSync } from "node:fs";
|
|
14
14
|
import "postcss";
|
|
15
|
+
import "micromatch";
|
|
15
16
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
16
17
|
import "fast-glob";
|
|
17
|
-
import "micromatch";
|
|
18
18
|
import "tailwindcss-config";
|
|
19
19
|
import _babelTraverse from "@babel/traverse";
|
|
20
20
|
import { parse } from "@babel/parser";
|
|
@@ -44,6 +44,68 @@ function createDebug(prefix) {
|
|
|
44
44
|
return debug;
|
|
45
45
|
}
|
|
46
46
|
//#endregion
|
|
47
|
+
//#region src/tailwindcss/source-scan.ts
|
|
48
|
+
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
49
|
+
"html",
|
|
50
|
+
"wxml",
|
|
51
|
+
"axml",
|
|
52
|
+
"jxml",
|
|
53
|
+
"ksml",
|
|
54
|
+
"ttml",
|
|
55
|
+
"qml",
|
|
56
|
+
"tyml",
|
|
57
|
+
"xhsml",
|
|
58
|
+
"swan",
|
|
59
|
+
"vue",
|
|
60
|
+
"mpx",
|
|
61
|
+
"js",
|
|
62
|
+
"jsx",
|
|
63
|
+
"ts",
|
|
64
|
+
"tsx"
|
|
65
|
+
];
|
|
66
|
+
const FULL_SOURCE_SCAN_EXTENSIONS = [
|
|
67
|
+
"js",
|
|
68
|
+
"jsx",
|
|
69
|
+
"mjs",
|
|
70
|
+
"cjs",
|
|
71
|
+
"ts",
|
|
72
|
+
"tsx",
|
|
73
|
+
"mts",
|
|
74
|
+
"cts",
|
|
75
|
+
"vue",
|
|
76
|
+
"uvue",
|
|
77
|
+
"nvue",
|
|
78
|
+
"svelte",
|
|
79
|
+
"mpx",
|
|
80
|
+
"html",
|
|
81
|
+
"wxml",
|
|
82
|
+
"axml",
|
|
83
|
+
"jxml",
|
|
84
|
+
"ksml",
|
|
85
|
+
"ttml",
|
|
86
|
+
"qml",
|
|
87
|
+
"tyml",
|
|
88
|
+
"xhsml",
|
|
89
|
+
"swan",
|
|
90
|
+
"css",
|
|
91
|
+
"wxss",
|
|
92
|
+
"acss",
|
|
93
|
+
"jxss",
|
|
94
|
+
"ttss",
|
|
95
|
+
"qss",
|
|
96
|
+
"tyss",
|
|
97
|
+
"scss",
|
|
98
|
+
"sass",
|
|
99
|
+
"less",
|
|
100
|
+
"styl",
|
|
101
|
+
"stylus"
|
|
102
|
+
];
|
|
103
|
+
function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
104
|
+
return `**/*.{${extensions.join(",")}}`;
|
|
105
|
+
}
|
|
106
|
+
createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
|
|
107
|
+
new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
|
|
108
|
+
//#endregion
|
|
47
109
|
//#region src/utils/object.ts
|
|
48
110
|
function definedEntries(value) {
|
|
49
111
|
return Object.entries(value).filter(([, item]) => item !== void 0);
|
|
@@ -419,29 +481,6 @@ function createTailwindV3DefaultColorThemeCss() {
|
|
|
419
481
|
" margin: auto;",
|
|
420
482
|
"}"
|
|
421
483
|
].join("\n");
|
|
422
|
-
//#endregion
|
|
423
|
-
//#region src/tailwindcss/source-scan.ts
|
|
424
|
-
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
425
|
-
"html",
|
|
426
|
-
"wxml",
|
|
427
|
-
"axml",
|
|
428
|
-
"jxml",
|
|
429
|
-
"ksml",
|
|
430
|
-
"ttml",
|
|
431
|
-
"qml",
|
|
432
|
-
"tyml",
|
|
433
|
-
"xhsml",
|
|
434
|
-
"swan",
|
|
435
|
-
"vue",
|
|
436
|
-
"mpx",
|
|
437
|
-
"js",
|
|
438
|
-
"jsx",
|
|
439
|
-
"ts",
|
|
440
|
-
"tsx"
|
|
441
|
-
];
|
|
442
|
-
function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
443
|
-
return `**/*.{${extensions.join(",")}}`;
|
|
444
|
-
}
|
|
445
484
|
createStyleHandler({
|
|
446
485
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
447
486
|
cssRemoveHoverPseudoClass: true,
|
|
@@ -453,43 +492,6 @@ createStyleHandler({
|
|
|
453
492
|
"@tailwind components;",
|
|
454
493
|
"@tailwind utilities;"
|
|
455
494
|
].join("\n");
|
|
456
|
-
createSourceScanPattern([
|
|
457
|
-
"js",
|
|
458
|
-
"jsx",
|
|
459
|
-
"mjs",
|
|
460
|
-
"cjs",
|
|
461
|
-
"ts",
|
|
462
|
-
"tsx",
|
|
463
|
-
"mts",
|
|
464
|
-
"cts",
|
|
465
|
-
"vue",
|
|
466
|
-
"uvue",
|
|
467
|
-
"nvue",
|
|
468
|
-
"svelte",
|
|
469
|
-
"mpx",
|
|
470
|
-
"html",
|
|
471
|
-
"wxml",
|
|
472
|
-
"axml",
|
|
473
|
-
"jxml",
|
|
474
|
-
"ksml",
|
|
475
|
-
"ttml",
|
|
476
|
-
"qml",
|
|
477
|
-
"tyml",
|
|
478
|
-
"xhsml",
|
|
479
|
-
"swan",
|
|
480
|
-
"css",
|
|
481
|
-
"wxss",
|
|
482
|
-
"acss",
|
|
483
|
-
"jxss",
|
|
484
|
-
"ttss",
|
|
485
|
-
"qss",
|
|
486
|
-
"tyss",
|
|
487
|
-
"scss",
|
|
488
|
-
"sass",
|
|
489
|
-
"less",
|
|
490
|
-
"styl",
|
|
491
|
-
"stylus"
|
|
492
|
-
]);
|
|
493
495
|
createDebug("[tailwindcss:runtime-patch] ");
|
|
494
496
|
createRequire(import.meta.url);
|
|
495
497
|
createDebug("[tailwindcss:runtime] ");
|
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_precheck = require("./precheck-
|
|
3
|
+
const require_precheck = require("./precheck-CTRQCNuH.js");
|
|
4
4
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
5
5
|
//#region src/core.ts
|
|
6
6
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-
|
|
1
|
+
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-Bbcmh24Z.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 });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-DHsPM4ye.mjs";
|
|
2
2
|
//#region src/generator/options.ts
|
|
3
3
|
function normalizeWeappTailwindcssGeneratorOptions(options) {
|
|
4
4
|
if (options == null) return {
|
package/dist/generator.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_generator = require("./generator-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-DpaX1FqH.js");
|
|
4
|
+
const require_generator = require("./generator-CQ8A3YVm.js");
|
|
5
5
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
6
6
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
7
7
|
exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
|
package/dist/generator.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-DHsPM4ye.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-CbjnpVed.mjs";
|
|
3
3
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
package/dist/gulp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
-
const require_source_candidates = require("./source-candidates-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-DpaX1FqH.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-BMo8s7do.js");
|
|
5
|
+
const require_precheck = require("./precheck-CTRQCNuH.js");
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-DO30H8ux.js");
|
|
7
|
+
const require_source_candidates = require("./source-candidates-CVp7TQFL.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
10
|
let node_path = require("node:path");
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-
|
|
3
|
-
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-
|
|
4
|
-
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
5
|
-
import { t as createSourceCandidateCollector } from "./source-candidates-
|
|
1
|
+
import { V as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-DHsPM4ye.mjs";
|
|
2
|
+
import { i as generateCssByGenerator, l as normalizeTailwindSourceForGenerator, o as processCachedTask, r as emitHmrTiming, s as hasTailwindRootDirectives, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-Cwq1Wbo2.mjs";
|
|
3
|
+
import { _ as ensureRuntimeClassSet, g as createTailwindRuntimeReadyPromise, n as getCompilerContext, t as shouldSkipJsTransform } from "./precheck-Bbcmh24Z.mjs";
|
|
4
|
+
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-P0OQvEif.mjs";
|
|
5
|
+
import { t as createSourceCandidateCollector } from "./source-candidates-B3NL91dO.mjs";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
package/dist/{incremental-runtime-class-set-CfznDtJ0.js → incremental-runtime-class-set-BMo8s7do.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_precheck = require("./precheck-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-DpaX1FqH.js");
|
|
3
|
+
const require_generator = require("./generator-CQ8A3YVm.js");
|
|
4
|
+
const require_precheck = require("./precheck-CTRQCNuH.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-DO30H8ux.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
let postcss = require("postcss");
|
|
8
8
|
postcss = require_chunk.__toESM(postcss);
|
|
@@ -750,7 +750,8 @@ function insertHoistedRules(root, rules, anchor) {
|
|
|
750
750
|
const firstRule = rules[0];
|
|
751
751
|
if (!firstRule) return;
|
|
752
752
|
if (anchor) {
|
|
753
|
-
|
|
753
|
+
if (anchor.raws.before === void 0) delete firstRule.raws.before;
|
|
754
|
+
else firstRule.raws.before = anchor.raws.before;
|
|
754
755
|
anchor.replaceWith(rules);
|
|
755
756
|
return;
|
|
756
757
|
}
|
|
@@ -1133,9 +1134,7 @@ function createSingleTailwindV4SourceOptions(sourceOptions, options) {
|
|
|
1133
1134
|
return require_v3_engine.omitUndefined({
|
|
1134
1135
|
projectRoot: sourceOptions.projectRoot,
|
|
1135
1136
|
baseFallbacks: sourceOptions.baseFallbacks,
|
|
1136
|
-
sources: sourceOptions.sources,
|
|
1137
1137
|
packageName: sourceOptions.packageName,
|
|
1138
|
-
outputRoot: sourceOptions.outputRoot,
|
|
1139
1138
|
base: options.base,
|
|
1140
1139
|
css: options.css
|
|
1141
1140
|
});
|
|
@@ -1247,11 +1246,6 @@ function tryResolveTailwindV4SourceOptions(runtimeState) {
|
|
|
1247
1246
|
function hasConfiguredTailwindV4CssSource(sourceOptions) {
|
|
1248
1247
|
return Boolean(sourceOptions?.css) || Boolean(sourceOptions?.cssSources?.length);
|
|
1249
1248
|
}
|
|
1250
|
-
function resolveTailwindV4CssSourceBase(cssSource, fallbackBase) {
|
|
1251
|
-
if (typeof cssSource.base === "string" && cssSource.base.length > 0) return cssSource.base;
|
|
1252
|
-
if (typeof cssSource.file === "string" && cssSource.file.length > 0) return node_path.default.dirname(cssSource.file);
|
|
1253
|
-
return fallbackBase;
|
|
1254
|
-
}
|
|
1255
1249
|
async function resolveSingleTailwindV4CssSource(cssSource, sourceOptions) {
|
|
1256
1250
|
const source = await require_v3_engine.resolveTailwindV4Source({
|
|
1257
1251
|
...require_v3_engine.omitUndefined(sourceOptions),
|
|
@@ -1260,13 +1254,13 @@ async function resolveSingleTailwindV4CssSource(cssSource, sourceOptions) {
|
|
|
1260
1254
|
const sourceBaseFallback = sourceOptions.base ?? sourceOptions.projectRoot ?? node_process.default.cwd();
|
|
1261
1255
|
return withGeneratorSourceMetadata(source, {
|
|
1262
1256
|
matchedCssSourceFile: typeof cssSource.file === "string" ? cssSource.file : void 0,
|
|
1263
|
-
sourceBase: resolveTailwindV4CssSourceBase(cssSource, sourceBaseFallback),
|
|
1257
|
+
sourceBase: require_v3_engine.resolveTailwindV4CssSourceBase(cssSource, sourceBaseFallback),
|
|
1264
1258
|
sourceCss: cssSource.css
|
|
1265
1259
|
});
|
|
1266
1260
|
}
|
|
1267
1261
|
async function resolveTailwindV4CssSourceEntries(cssSource, sourceOptions) {
|
|
1268
1262
|
if (typeof cssSource.css !== "string" || cssSource.css.length === 0) return;
|
|
1269
|
-
const sourceBase = resolveTailwindV4CssSourceBase(cssSource, sourceOptions.base ?? sourceOptions.projectRoot ?? node_process.default.cwd());
|
|
1263
|
+
const sourceBase = require_v3_engine.resolveTailwindV4CssSourceBase(cssSource, sourceOptions.base ?? sourceOptions.projectRoot ?? node_process.default.cwd());
|
|
1270
1264
|
return require_v3_engine.resolveTailwindV4EntriesFromCss(cssSource.css, sourceBase);
|
|
1271
1265
|
}
|
|
1272
1266
|
function countRuntimeCandidateHits(candidates, runtime) {
|
|
@@ -1411,7 +1405,10 @@ async function resolveGeneratorSources(majorVersion, runtimeState, rawSource, fi
|
|
|
1411
1405
|
importFallback: generatorOptions?.importFallback ?? false,
|
|
1412
1406
|
removeConfig: majorVersion === 3
|
|
1413
1407
|
});
|
|
1414
|
-
if (majorVersion !== 4 || cssEntrySource && !cssHandlerOptions.isMainChunk)
|
|
1408
|
+
if (majorVersion !== 4 || cssEntrySource && !cssHandlerOptions.isMainChunk) {
|
|
1409
|
+
const resolved = await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions);
|
|
1410
|
+
return resolved ? [resolved] : [];
|
|
1411
|
+
}
|
|
1415
1412
|
let sourceOptions;
|
|
1416
1413
|
try {
|
|
1417
1414
|
sourceOptions = require_v3_engine.omitUndefined({
|
|
@@ -1419,7 +1416,8 @@ async function resolveGeneratorSources(majorVersion, runtimeState, rawSource, fi
|
|
|
1419
1416
|
...resolveCssHandlerSourceOptions(cssHandlerOptions)
|
|
1420
1417
|
});
|
|
1421
1418
|
} catch {
|
|
1422
|
-
|
|
1419
|
+
const resolved = await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions);
|
|
1420
|
+
return resolved ? [resolved] : [];
|
|
1423
1421
|
}
|
|
1424
1422
|
const matchedCssEntrySource = cssEntrySource ? await resolveMatchingTailwindV4CssEntry(rawSource, file, sourceOptions) : void 0;
|
|
1425
1423
|
const matchedCssSource = await resolveMatchingTailwindV4CssSource(rawSource, file, cssHandlerOptions, sourceOptions);
|
|
@@ -1433,7 +1431,8 @@ async function resolveGeneratorSources(majorVersion, runtimeState, rawSource, fi
|
|
|
1433
1431
|
} : preferredCssEntrySource];
|
|
1434
1432
|
if (!sourceOptions.cssEntries || sourceOptions.cssEntries.length <= 1) {
|
|
1435
1433
|
if (sourceOptions.cssSources?.length === 1) return [await createTailwindV4CssSourceResolver(sourceOptions, generatorOptions)(sourceOptions.cssSources[0])];
|
|
1436
|
-
|
|
1434
|
+
const resolved = await resolveGeneratorSource(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions);
|
|
1435
|
+
return resolved ? [resolved] : [];
|
|
1437
1436
|
}
|
|
1438
1437
|
const cssEntrySources = await Promise.all(sourceOptions.cssEntries.map((cssEntry) => require_v3_engine.resolveTailwindV4Source({
|
|
1439
1438
|
...require_v3_engine.omitUndefined(sourceOptions),
|
|
@@ -1464,7 +1463,7 @@ async function resolveGeneratorSourceEntries(source, runtimeState) {
|
|
|
1464
1463
|
if (dependencyResolved?.entries.length) return dependencyResolved.entries;
|
|
1465
1464
|
} catch {}
|
|
1466
1465
|
}
|
|
1467
|
-
return resolved
|
|
1466
|
+
return resolved?.entries;
|
|
1468
1467
|
}
|
|
1469
1468
|
//#endregion
|
|
1470
1469
|
//#region src/bundlers/shared/generator-css/legacy-compat.ts
|
|
@@ -1886,10 +1885,11 @@ async function generateCssByGenerator(options) {
|
|
|
1886
1885
|
cssHandlerOptions,
|
|
1887
1886
|
isolateCssSource
|
|
1888
1887
|
}) : runtime;
|
|
1888
|
+
const generatorRuntime = majorVersion === 4 && generatorOptions.target === "weapp" ? require_v3_engine.filterUnsupportedMiniProgramTailwindV4Candidates(sourceRuntime) : sourceRuntime;
|
|
1889
1889
|
return generator.generate({
|
|
1890
|
-
candidates:
|
|
1890
|
+
candidates: generatorRuntime,
|
|
1891
1891
|
incrementalCache: majorVersion === 3 || majorVersion === 4,
|
|
1892
|
-
scanSources: majorVersion === 4 &&
|
|
1892
|
+
scanSources: majorVersion === 4 && generatorRuntime.size === 0 && !isolateCssSource,
|
|
1893
1893
|
styleOptions: generatorStyleOptions,
|
|
1894
1894
|
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
1895
1895
|
target: generatorOptions.target
|
|
@@ -2067,6 +2067,39 @@ function createHmrTimingRecorder(bundler) {
|
|
|
2067
2067
|
//#region src/bundlers/vite/incremental-runtime-class-set.ts
|
|
2068
2068
|
const debug = require_v3_engine.createDebug("[vite:runtime-set] ");
|
|
2069
2069
|
const EXTENSION_DOT_PREFIX_RE = /^\./;
|
|
2070
|
+
const VENDOR_CHUNK_BASENAME_RE = /^(?:vendor|vendors|chunk-vendors|common_vendor)(?:[.-]|$)/i;
|
|
2071
|
+
const COMMON_VENDOR_CHUNK_RE = /^(?:common|static|assets|chunks?)\/(?:vendor|vendors|chunk-vendors|common_vendor|runtime)(?:[.-]|$)/i;
|
|
2072
|
+
function toPosixPath(value) {
|
|
2073
|
+
return value.split("\\").join("/");
|
|
2074
|
+
}
|
|
2075
|
+
function isDependencyModuleId(id) {
|
|
2076
|
+
const normalized = toPosixPath(id);
|
|
2077
|
+
return normalized.includes("/node_modules/") || normalized.includes("/.pnpm/") || normalized.includes("/node_modules_");
|
|
2078
|
+
}
|
|
2079
|
+
function collectChunkModuleIds(entry) {
|
|
2080
|
+
if (entry.output.type !== "chunk") return [];
|
|
2081
|
+
return [...entry.output.moduleIds, ...Object.keys(entry.output.modules ?? {})].filter((id, index, ids) => ids.indexOf(id) === index);
|
|
2082
|
+
}
|
|
2083
|
+
function isKnownVendorChunkFile(file) {
|
|
2084
|
+
const normalized = toPosixPath(file).replace(/^\.\//, "");
|
|
2085
|
+
const basename = normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
2086
|
+
return VENDOR_CHUNK_BASENAME_RE.test(basename) || COMMON_VENDOR_CHUNK_RE.test(normalized) || normalized.includes("/node_modules/") || normalized.includes("/node_modules_");
|
|
2087
|
+
}
|
|
2088
|
+
function isDependencyOnlyChunk(entry) {
|
|
2089
|
+
if (entry.output.type !== "chunk") return false;
|
|
2090
|
+
if (entry.output.isEntry || entry.output.isDynamicEntry || entry.output.isImplicitEntry) return false;
|
|
2091
|
+
const moduleIds = collectChunkModuleIds(entry);
|
|
2092
|
+
return moduleIds.length > 0 && moduleIds.every(isDependencyModuleId);
|
|
2093
|
+
}
|
|
2094
|
+
function isRuntimeCandidateEntry(entry) {
|
|
2095
|
+
if (entry.type === "html") return true;
|
|
2096
|
+
if (entry.type !== "js") return false;
|
|
2097
|
+
if (isDependencyOnlyChunk(entry)) return false;
|
|
2098
|
+
if (!isKnownVendorChunkFile(entry.file)) return true;
|
|
2099
|
+
if (entry.output.type !== "chunk") return false;
|
|
2100
|
+
if (entry.output.facadeModuleId && !isDependencyModuleId(entry.output.facadeModuleId)) return true;
|
|
2101
|
+
return collectChunkModuleIds(entry).some((id) => !isDependencyModuleId(id));
|
|
2102
|
+
}
|
|
2070
2103
|
function createExtractOptions(context, source) {
|
|
2071
2104
|
return {
|
|
2072
2105
|
cwd: context.projectRoot,
|
|
@@ -2078,7 +2111,7 @@ function createExtractOptions(context, source) {
|
|
|
2078
2111
|
};
|
|
2079
2112
|
}
|
|
2080
2113
|
function createRuntimeEntries(snapshot) {
|
|
2081
|
-
return snapshot.entries.filter(
|
|
2114
|
+
return snapshot.entries.filter(isRuntimeCandidateEntry);
|
|
2082
2115
|
}
|
|
2083
2116
|
function collectChangedRuntimeFiles(snapshot) {
|
|
2084
2117
|
return new Set([...snapshot.runtimeAffectingChangedByType.html, ...snapshot.runtimeAffectingChangedByType.js]);
|