weapp-tailwindcss 5.1.5 → 5.1.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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/bundlers/shared/generator-css/types.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +4 -1
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +7 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +10 -0
- package/dist/{context-rrYZuUBU.mjs → context-BqeDu1Ha.mjs} +5 -4
- package/dist/{context-BziwyWy1.js → context-C7KTDlrG.js} +5 -4
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-24-HgU9F.mjs → generator-BOt2Tvx3.mjs} +2 -2
- package/dist/{generator-CilgHtxb.js → generator-DASZwC6t.js} +2 -2
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-CuVsZdO9.js → gulp-D6hsaTLM.js} +4 -4
- package/dist/{gulp-ygWfmOqh.mjs → gulp-alDZryyB.mjs} +4 -4
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-BKdCeIrn.js → hmr-timing-BIr_CiPW.js} +55 -566
- package/dist/{hmr-timing-Dh_nn3w5.mjs → hmr-timing-CYwVMRol.mjs} +32 -513
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +2 -2
- package/dist/postcss.mjs +2 -2
- package/dist/presets.js +6 -3
- package/dist/presets.mjs +6 -3
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/runtime-branch/generator-target-env.d.ts +1 -0
- package/dist/{source-candidate-scan-signature-DATRnS1X.mjs → source-candidate-scan-signature-D97ZEXcj.mjs} +3 -3
- package/dist/{source-candidate-scan-signature-DIj9m4wB.js → source-candidate-scan-signature-Djr2Hw8y.js} +3 -3
- package/dist/{tailwindcss-C-uM4rB8.mjs → tailwindcss-DDGD90w7.mjs} +15 -2
- package/dist/{tailwindcss-BwoNQ3t8.js → tailwindcss-DPxJpRVP.js} +15 -2
- package/dist/{transform-KLD1tJdb.js → transform-CvqqZBuq.js} +1 -1
- package/dist/{transform-DHLemtaX.mjs → transform-DPPr79r2.mjs} +1 -1
- package/dist/uni-app-x/web-preflight-reset.d.ts +3 -0
- package/dist/{v4-engine-CKtsdKxK.js → v4-engine-3UmJkAY7.js} +641 -3
- package/dist/{v4-engine-BuuYDXt1.mjs → v4-engine-CYSrDVNp.mjs} +560 -6
- package/dist/{vite-Yp14HNyS.js → vite-BJRlG835.js} +636 -114
- package/dist/{vite-cH0tTMHc.mjs → vite-XxJh7Xtu.mjs} +637 -115
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +3078 -2907
- package/dist/{webpack-DN3tgLbF.js → webpack-BxBOMUtY.js} +286 -47
- package/dist/{webpack-DBhmJ-_P.mjs → webpack-eN8WzIT-.mjs} +280 -41
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
|
-
const require_v4_engine = require("./v4-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v4_engine = require("./v4-engine-3UmJkAY7.js");
|
|
3
|
+
const require_generator = require("./generator-DASZwC6t.js");
|
|
4
4
|
const require_utils = require("./utils-D3h8j7Mk.js");
|
|
5
|
-
const require_context = require("./context-
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
8
|
-
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-
|
|
5
|
+
const require_context = require("./context-C7KTDlrG.js");
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-DPxJpRVP.js");
|
|
7
|
+
const require_hmr_timing = require("./hmr-timing-BIr_CiPW.js");
|
|
8
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-Djr2Hw8y.js");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
10
10
|
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
11
11
|
let node_path = require("node:path");
|
|
@@ -396,6 +396,11 @@ function resolveWebpackGeneratorRawSource(rawSource, cssHandlerOptions) {
|
|
|
396
396
|
if (sourceCss && (require_v4_engine.hasTailwindRootDirectives(sourceCss, { importFallback: true }) || require_v4_engine.hasTailwindSourceDirectives(sourceCss, { importFallback: true }) || require_v4_engine.hasTailwindApplyDirective(sourceCss) || require_v4_engine.hasTailwindGeneratedCss(sourceCss) || require_v4_engine.hasTailwindGeneratedCssMarkers(sourceCss))) return sourceCss;
|
|
397
397
|
return rawSource;
|
|
398
398
|
}
|
|
399
|
+
function shouldConsumeWebpackLoaderGeneratedCss(options) {
|
|
400
|
+
if (!options.shouldRegenerateExplicitTailwindV4CssSource) return true;
|
|
401
|
+
if (options.watchMode === true && options.loaderGeneratedClassSet && options.sourceCandidates && hasMissingRuntimeCandidates(options.loaderGeneratedClassSet, options.sourceCandidates)) return false;
|
|
402
|
+
return options.hasBundlerGeneratedCssMarker;
|
|
403
|
+
}
|
|
399
404
|
function hasUsableWebpackGeneratorCssSources(cssSources) {
|
|
400
405
|
return Array.isArray(cssSources) && cssSources.some((source) => typeof source?.css === "string" && source.css.length > 0);
|
|
401
406
|
}
|
|
@@ -447,7 +452,8 @@ function hasProcessedCssAssetUrl(css) {
|
|
|
447
452
|
return /url\(\s*["']?data:/i.test(css);
|
|
448
453
|
}
|
|
449
454
|
function shouldUseWebpackAssetAsGeneratorUserCss(rawSource, generatorRawSource, options = {}) {
|
|
450
|
-
|
|
455
|
+
const rawMarkers = collectWebpackAssetUserCssMarkers(rawSource);
|
|
456
|
+
return rawSource !== generatorRawSource && (options.processed === true || !rawSource.includes("data:")) && !require_v4_engine.hasTailwindRootDirectives(rawSource, { importFallback: true }) && !require_v4_engine.hasTailwindSourceDirectives(rawSource, { importFallback: true }) && !require_v4_engine.hasTailwindApplyDirective(rawSource) && rawMarkers.size > 0 && !isOnlyWebpackTailwindGeneratedPreflightCss(rawSource) && (!require_v4_engine.hasTailwindGeneratedCssMarkers(rawSource) || hasAdditionalWebpackAssetUserCssMarkers(rawSource, generatorRawSource));
|
|
451
457
|
}
|
|
452
458
|
function collectWebpackAssetUserCssMarkers(source) {
|
|
453
459
|
const markers = /* @__PURE__ */ new Set();
|
|
@@ -469,6 +475,44 @@ function collectWebpackAssetUserCssMarkers(source) {
|
|
|
469
475
|
} catch {}
|
|
470
476
|
return markers;
|
|
471
477
|
}
|
|
478
|
+
function hasWebpackClassSelector(selector) {
|
|
479
|
+
return /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i.test(selector);
|
|
480
|
+
}
|
|
481
|
+
function isWebpackKeyframesRule(rule) {
|
|
482
|
+
let parent = rule.parent;
|
|
483
|
+
while (parent) {
|
|
484
|
+
if (parent.type === "atrule" && parent.name.endsWith("keyframes")) return true;
|
|
485
|
+
parent = parent.parent;
|
|
486
|
+
}
|
|
487
|
+
return false;
|
|
488
|
+
}
|
|
489
|
+
function collectWebpackBareSelectorUserCss(source) {
|
|
490
|
+
try {
|
|
491
|
+
const root = _weapp_tailwindcss_postcss.postcss.parse(require_v4_engine.removeTailwindSourceDirectives(require_v4_engine.stripTailwindSourceMediaFragments(require_v4_engine.removeTailwindV4GeneratorAtRules(source)), { importFallback: true }));
|
|
492
|
+
let changed = false;
|
|
493
|
+
root.walkAtRules((rule) => {
|
|
494
|
+
if (rule.name === "import" || rule.name === "font-face" || rule.name.endsWith("keyframes")) {
|
|
495
|
+
rule.remove();
|
|
496
|
+
changed = true;
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
root.walkRules((rule) => {
|
|
500
|
+
if (isWebpackKeyframesRule(rule) || rule.selectors.some((selector) => hasWebpackClassSelector(selector))) {
|
|
501
|
+
rule.remove();
|
|
502
|
+
changed = true;
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
root.walkAtRules((rule) => {
|
|
506
|
+
if (rule.nodes !== void 0 && rule.nodes.length === 0) {
|
|
507
|
+
rule.remove();
|
|
508
|
+
changed = true;
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
return changed ? root.toString() : source;
|
|
512
|
+
} catch {
|
|
513
|
+
return "";
|
|
514
|
+
}
|
|
515
|
+
}
|
|
472
516
|
const WEBPACK_TAILWIND_GENERATED_LAYER_NAMES = /* @__PURE__ */ new Set([
|
|
473
517
|
"theme",
|
|
474
518
|
"base",
|
|
@@ -477,11 +521,31 @@ const WEBPACK_TAILWIND_GENERATED_LAYER_NAMES = /* @__PURE__ */ new Set([
|
|
|
477
521
|
const WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE = /(?:^|[^\w-])\.[^,{]{0,512}(?:\\:|\\\[|\\#)/;
|
|
478
522
|
const WEBPACK_TAILWIND_UTILITY_PREFIX_RE = /^\.(?:-?(?:bg|text|border|ring|shadow|drop-shadow|[pmwhz]|px|py|pt|pr|pb|pl|mx|my|mt|mr|mb|ml|min-w|min-h|max-w|max-h|flex|grid|inline|block|hidden|rounded|opacity|translate|scale|rotate|skew|top|right|bottom|left|inset|gap|font|leading|tracking|underline|container)(?:[\-\\{]|$)|\\\[)/;
|
|
479
523
|
const WEBPACK_TAILWIND_BANNER_RE = /tailwindcss v4\./;
|
|
524
|
+
const WEBPACK_TAILWIND_PREFLIGHT_SELECTORS = /* @__PURE__ */ new Set([
|
|
525
|
+
"*",
|
|
526
|
+
":after",
|
|
527
|
+
":before",
|
|
528
|
+
"::after",
|
|
529
|
+
"::before",
|
|
530
|
+
"::backdrop",
|
|
531
|
+
"view",
|
|
532
|
+
"text"
|
|
533
|
+
]);
|
|
534
|
+
const WEBPACK_TAILWIND_PREFLIGHT_PROPS = /* @__PURE__ */ new Set([
|
|
535
|
+
"box-sizing",
|
|
536
|
+
"border",
|
|
537
|
+
"border-width",
|
|
538
|
+
"border-style",
|
|
539
|
+
"border-color",
|
|
540
|
+
"margin",
|
|
541
|
+
"padding"
|
|
542
|
+
]);
|
|
543
|
+
const WEBPACK_TAILWIND_THEME_TOKEN_RE = /^--(?:tw-|color-|spacing|breakpoint-|container-|text-|font-|tracking-|leading-|radius-|shadow-|inset-shadow-|drop-shadow-|ease-|animate-|blur-|perspective-|aspect-|default-)/;
|
|
480
544
|
function parseWebpackCssLayerNames(params) {
|
|
481
545
|
return params.split(",").map((name) => name.trim()).filter(Boolean);
|
|
482
546
|
}
|
|
483
547
|
function removeWebpackTailwindGeneratedAssetCss(source) {
|
|
484
|
-
const cleaned =
|
|
548
|
+
const cleaned = require_v4_engine.removeTailwindV4GeneratedUserCssArtifacts(source);
|
|
485
549
|
try {
|
|
486
550
|
const root = _weapp_tailwindcss_postcss.postcss.parse(cleaned);
|
|
487
551
|
let changed = false;
|
|
@@ -512,18 +576,21 @@ function removeWebpackTailwindGeneratedAssetCss(source) {
|
|
|
512
576
|
return;
|
|
513
577
|
}
|
|
514
578
|
if (shouldRemoveLayer && !names.includes("utilities")) {
|
|
515
|
-
rule.
|
|
516
|
-
|
|
579
|
+
for (const child of [...rule.nodes ?? []]) if (isWebpackTailwindGeneratedLayerNode(child, names)) {
|
|
580
|
+
child.remove();
|
|
581
|
+
changed = true;
|
|
582
|
+
}
|
|
583
|
+
if (rule.nodes?.length === 0) {
|
|
584
|
+
rule.remove();
|
|
585
|
+
changed = true;
|
|
586
|
+
}
|
|
517
587
|
return;
|
|
518
588
|
}
|
|
519
589
|
if (shouldRemoveLayer) {
|
|
520
|
-
rule.
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
changed = true;
|
|
525
|
-
}
|
|
526
|
-
});
|
|
590
|
+
for (const child of [...rule.nodes ?? []]) if (isWebpackTailwindGeneratedLayerNode(child, names)) {
|
|
591
|
+
child.remove();
|
|
592
|
+
changed = true;
|
|
593
|
+
}
|
|
527
594
|
if (rule.nodes?.length === 0) {
|
|
528
595
|
rule.remove();
|
|
529
596
|
changed = true;
|
|
@@ -533,7 +600,7 @@ function removeWebpackTailwindGeneratedAssetCss(source) {
|
|
|
533
600
|
root.walkRules((rule) => {
|
|
534
601
|
if (rule.parent?.type === "atrule" && rule.parent.name === "layer") return;
|
|
535
602
|
const selector = rule.selector.trim();
|
|
536
|
-
if (WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE.test(selector)) {
|
|
603
|
+
if (WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE.test(selector) || isWebpackTailwindGeneratedPreflightRule(rule)) {
|
|
537
604
|
rule.remove();
|
|
538
605
|
changed = true;
|
|
539
606
|
}
|
|
@@ -556,14 +623,59 @@ function removeWebpackTailwindGeneratedAssetCss(source) {
|
|
|
556
623
|
}
|
|
557
624
|
}
|
|
558
625
|
function isWebpackTailwindGeneratedPrefixNode(node) {
|
|
559
|
-
if (node.type === "rule") return node
|
|
626
|
+
if (node.type === "rule") return isWebpackTailwindGeneratedRule(node, [
|
|
627
|
+
"theme",
|
|
628
|
+
"base",
|
|
629
|
+
"utilities"
|
|
630
|
+
], true);
|
|
560
631
|
if (node.type !== "atrule") return false;
|
|
561
632
|
const names = node.name === "layer" ? parseWebpackCssLayerNames(node.params) : [];
|
|
562
633
|
if (node.name === "property" && node.params.trim().startsWith("--tw-")) return true;
|
|
563
|
-
if (names.length > 0 && names.every((name) => WEBPACK_TAILWIND_GENERATED_LAYER_NAMES.has(name)))
|
|
634
|
+
if (names.length > 0 && names.every((name) => WEBPACK_TAILWIND_GENERATED_LAYER_NAMES.has(name))) {
|
|
635
|
+
if (node.nodes === void 0) return true;
|
|
636
|
+
return node.nodes.length > 0 && node.nodes.every((child) => isWebpackTailwindGeneratedLayerNode(child, names));
|
|
637
|
+
}
|
|
564
638
|
if (node.nodes === void 0 || node.nodes.length === 0) return false;
|
|
565
639
|
return node.nodes.every((child) => isWebpackTailwindGeneratedPrefixNode(child));
|
|
566
640
|
}
|
|
641
|
+
function isWebpackTailwindGeneratedLayerNode(node, layerNames) {
|
|
642
|
+
if (node.type === "rule") return isWebpackTailwindGeneratedRule(node, layerNames, false);
|
|
643
|
+
if (node.type !== "atrule") return false;
|
|
644
|
+
if (node.name === "property" && node.params.trim().startsWith("--tw-")) return true;
|
|
645
|
+
if (node.nodes === void 0 || node.nodes.length === 0) return false;
|
|
646
|
+
return node.nodes.every((child) => isWebpackTailwindGeneratedLayerNode(child, layerNames));
|
|
647
|
+
}
|
|
648
|
+
function isWebpackTailwindGeneratedRule(rule, layerNames, includePrefix) {
|
|
649
|
+
const selectors = rule.selectors ?? [rule.selector];
|
|
650
|
+
if (selectors.every((selector) => isWebpackTailwindGeneratedUtilitySelector(selector.trim(), includePrefix))) return true;
|
|
651
|
+
if (selectors.every((selector) => isWebpackTailwindGeneratedUtilitySelector(selector.trim(), true))) return true;
|
|
652
|
+
if (layerNames.includes("theme") && isWebpackTailwindGeneratedThemeRule(rule)) return true;
|
|
653
|
+
if (layerNames.includes("base") && isWebpackTailwindGeneratedPreflightRule(rule)) return true;
|
|
654
|
+
return false;
|
|
655
|
+
}
|
|
656
|
+
function isWebpackTailwindGeneratedThemeRule(rule) {
|
|
657
|
+
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
658
|
+
return declarations.length > 0 && declarations.every((decl) => WEBPACK_TAILWIND_THEME_TOKEN_RE.test(decl.prop) || decl.value.includes("--theme("));
|
|
659
|
+
}
|
|
660
|
+
function isWebpackTailwindGeneratedPreflightRule(rule) {
|
|
661
|
+
const selectors = rule.selectors ?? [rule.selector];
|
|
662
|
+
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
663
|
+
return selectors.length > 0 && declarations.length > 0 && selectors.every((selector) => {
|
|
664
|
+
const normalized = selector.trim().replace(/\s+/g, " ");
|
|
665
|
+
return WEBPACK_TAILWIND_PREFLIGHT_SELECTORS.has(normalized);
|
|
666
|
+
}) && declarations.every((decl) => WEBPACK_TAILWIND_PREFLIGHT_PROPS.has(decl.prop));
|
|
667
|
+
}
|
|
668
|
+
function isOnlyWebpackTailwindGeneratedPreflightCss(source) {
|
|
669
|
+
try {
|
|
670
|
+
const nodes = _weapp_tailwindcss_postcss.postcss.parse(source).nodes ?? [];
|
|
671
|
+
return nodes.length > 0 && nodes.every((node) => {
|
|
672
|
+
if (node.type === "rule") return isWebpackTailwindGeneratedPreflightRule(node);
|
|
673
|
+
return node.type === "atrule" && (node.nodes === void 0 || node.nodes.length === 0);
|
|
674
|
+
});
|
|
675
|
+
} catch {
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
567
679
|
function isWebpackTailwindGeneratedUtilitySelector(selector, includePrefix) {
|
|
568
680
|
return WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE.test(selector) || includePrefix && WEBPACK_TAILWIND_UTILITY_PREFIX_RE.test(selector);
|
|
569
681
|
}
|
|
@@ -748,7 +860,7 @@ function includesTailwindPreflightImport(source) {
|
|
|
748
860
|
function finalizeMiniProgramUserCssAssetSource(source, compilerOptions, isWebGeneratorTarget, options = {}) {
|
|
749
861
|
const styleOptions = require_context.resolveStyleOptionsFromContext(compilerOptions);
|
|
750
862
|
if (isWebGeneratorTarget) return source;
|
|
751
|
-
return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(removeTailwindV4StandaloneHostPreflightRule((0, _weapp_tailwindcss_postcss.finalizeMiniProgramCss)(
|
|
863
|
+
return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(removeTailwindV4StandaloneHostPreflightRule((0, _weapp_tailwindcss_postcss.finalizeMiniProgramCss)(require_v4_engine.removeMiniProgramHoverSelectors(source, styleOptions.cssRemoveHoverPseudoClass), {
|
|
752
864
|
cssPreflight: options.cssPreflight === false ? false : !require_hmr_timing.hasMiniProgramTailwindV4PreflightReset(source) ? compilerOptions.cssPreflight : void 0,
|
|
753
865
|
isTailwindcssV4: true,
|
|
754
866
|
tailwindcssV4GradientFallback: styleOptions.tailwindcssV4GradientFallback
|
|
@@ -821,21 +933,20 @@ function finalizeTracedWebpackCssAsset(css, cssHandlerOptions, options) {
|
|
|
821
933
|
function finalizeWebpackCssAssetSource(source, compilerOptions, isWebGeneratorTarget, options = {}) {
|
|
822
934
|
const styleOptions = require_context.resolveStyleOptionsFromContext(compilerOptions);
|
|
823
935
|
if (isWebGeneratorTarget) {
|
|
824
|
-
if (options.generatedCss === true) return stripTrailingLineWhitespace(
|
|
825
|
-
return stripTrailingLineWhitespace(
|
|
936
|
+
if (options.generatedCss === true) return stripTrailingLineWhitespace(require_v4_engine.stripUnmatchedTailwindSourceMediaCloseFragments(require_v4_engine.stripTailwindSourceMediaFragments(require_source_candidate_scan_signature.stripBundlerGeneratedCssMarkers(source))));
|
|
937
|
+
return stripTrailingLineWhitespace(require_v4_engine.stripUnmatchedTailwindSourceMediaCloseFragments(require_v4_engine.stripTailwindSourceMediaFragments(require_v4_engine.removeTailwindV4GeneratorAtRules(require_v4_engine.removeTailwindSourceDirectives(require_source_candidate_scan_signature.stripBundlerGeneratedCssMarkers(source), { importFallback: true })))));
|
|
826
938
|
}
|
|
827
939
|
let finalized = require_v4_engine.removeTailwindSourceDirectives(require_source_candidate_scan_signature.stripBundlerGeneratedCssMarkers(source), { importFallback: true });
|
|
828
|
-
if (options.generatedCss !== true) return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(
|
|
940
|
+
if (options.generatedCss !== true) return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(require_v4_engine.removeMiniProgramHoverSelectors(finalized, styleOptions.cssRemoveHoverPseudoClass));
|
|
829
941
|
try {
|
|
830
942
|
finalized = (0, _weapp_tailwindcss_postcss.pruneMiniProgramGeneratedCss)(finalized, { preservePreflight: options.cssPreflight !== false });
|
|
831
|
-
} catch {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(require_hmr_timing.removeMiniProgramHoverSelectors(finalized, styleOptions.cssRemoveHoverPseudoClass));
|
|
943
|
+
} catch {}
|
|
944
|
+
finalized = (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCss)(finalized, {
|
|
945
|
+
cssPreflight: options.cssPreflight === false ? false : !require_hmr_timing.hasMiniProgramTailwindV4PreflightReset(finalized) ? compilerOptions.cssPreflight : void 0,
|
|
946
|
+
isTailwindcssV4: true,
|
|
947
|
+
tailwindcssV4GradientFallback: styleOptions.tailwindcssV4GradientFallback
|
|
948
|
+
});
|
|
949
|
+
return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(require_v4_engine.removeMiniProgramHoverSelectors(finalized, styleOptions.cssRemoveHoverPseudoClass));
|
|
839
950
|
}
|
|
840
951
|
function collectWebpackJsRuntimeCandidatesFromAssets(options) {
|
|
841
952
|
if (options.isWebGeneratorTarget) return;
|
|
@@ -876,6 +987,26 @@ function stringifyWebpackSourceLike(source) {
|
|
|
876
987
|
}
|
|
877
988
|
//#endregion
|
|
878
989
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.ts
|
|
990
|
+
function normalizeWebpackCssSourceRef(file) {
|
|
991
|
+
return file.replaceAll("\\", "/");
|
|
992
|
+
}
|
|
993
|
+
function collectWebpackCssTokenSourceRefs(source) {
|
|
994
|
+
const refs = /* @__PURE__ */ new Set();
|
|
995
|
+
for (const line of source.split("\n")) {
|
|
996
|
+
if (!line.includes("/* tokens:") || !line.includes("<=")) continue;
|
|
997
|
+
const traceStart = line.indexOf("<=");
|
|
998
|
+
const traceEnd = line.indexOf("*/", traceStart);
|
|
999
|
+
const trace = line.slice(traceStart + 2, traceEnd >= 0 ? traceEnd : void 0);
|
|
1000
|
+
for (const segment of trace.split("|")) {
|
|
1001
|
+
const sourceList = segment.replace(/^[^<]*<=\s*/, "").split(",");
|
|
1002
|
+
for (const ref of sourceList) {
|
|
1003
|
+
const normalizedRef = ref.trim();
|
|
1004
|
+
if (normalizedRef) refs.add(normalizeWebpackCssSourceRef(normalizedRef));
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return refs;
|
|
1009
|
+
}
|
|
879
1010
|
function createWebpackCssSourceResolvers(options) {
|
|
880
1011
|
const { activeWebpackAssetResourceFiles, appType, compilerOptions, compilation, cssAssetResources, cssHandlerOptionsCache, cssSources, cssUserHandlerOptionsCache, groupedCssEntriesLength, singleCssAssetFile, isWebGeneratorTarget, outputDir, runtimeState } = options;
|
|
881
1012
|
const hasConfiguredTailwindV4SourceRoots = () => {
|
|
@@ -943,6 +1074,19 @@ function createWebpackCssSourceResolvers(options) {
|
|
|
943
1074
|
return activeAssetResource;
|
|
944
1075
|
}
|
|
945
1076
|
if (rawSource) {
|
|
1077
|
+
const tokenSourceRefs = collectWebpackCssTokenSourceRefs(rawSource);
|
|
1078
|
+
if (tokenSourceRefs.size > 0) {
|
|
1079
|
+
const tokenSourceMatches = [...cssSources.keys()].filter((sourceFile) => {
|
|
1080
|
+
const relativeSourceFile = normalizeWebpackCssSourceRef(node_path.default.relative(compilerOptions.tailwindcssBasedir, sourceFile));
|
|
1081
|
+
const absoluteSourceFile = normalizeWebpackCssSourceRef(node_path.default.resolve(sourceFile));
|
|
1082
|
+
return tokenSourceRefs.has(relativeSourceFile) || tokenSourceRefs.has(absoluteSourceFile);
|
|
1083
|
+
}).sort();
|
|
1084
|
+
if (tokenSourceMatches.length === 1) {
|
|
1085
|
+
const sourceFile = tokenSourceMatches[0];
|
|
1086
|
+
activeWebpackCssSourceFiles.add(sourceFile);
|
|
1087
|
+
return sourceFile;
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
946
1090
|
const representedTailwindSourceMatches = [...cssSources.entries()].filter(([, source]) => isWebpackCssSourceRepresentedInAsset(rawSource, source.css)).map(([sourceFile]) => ({
|
|
947
1091
|
sourceFile,
|
|
948
1092
|
score: require_hmr_timing.scoreTailwindV4CssSourceFileMatch(file, sourceFile, {
|
|
@@ -1703,7 +1847,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1703
1847
|
return rawSource;
|
|
1704
1848
|
};
|
|
1705
1849
|
const chunkHash = assetHashByChunk.get(file);
|
|
1706
|
-
const cssHandlerOptionsForProcessedAsset = getCssHandlerOptions(file);
|
|
1850
|
+
const cssHandlerOptionsForProcessedAsset = getCssHandlerOptions(file, readRawSource());
|
|
1707
1851
|
const processedCssAssetMetadata = { isMainCssChunk: cssHandlerOptionsForProcessedAsset.isMainChunk };
|
|
1708
1852
|
const processedSourceFile = cssHandlerOptionsForProcessedAsset.sourceOptions?.sourceFile;
|
|
1709
1853
|
const processedSourceCss = processedSourceFile ? cssSources.get(node_path.default.resolve(processedSourceFile))?.css : void 0;
|
|
@@ -1738,9 +1882,10 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1738
1882
|
...source,
|
|
1739
1883
|
file: sourceFile
|
|
1740
1884
|
})), readCurrentProcessedRawSource()) !== void 0;
|
|
1885
|
+
const hasProcessedLoaderGeneratedUserCss = cachedSkipProcessedCssAsset === void 0 && processedLoaderGeneratedCss !== void 0 && hasAdditionalWebpackAssetUserCssMarkers(processedLoaderGeneratedCss.css, readCurrentProcessedRawSource());
|
|
1741
1886
|
const shouldFinalizeProcessedWebCssAsset = isWebGeneratorTarget && !shouldForceConfiguredMainCssGeneration && !shouldRegenerateProcessedTailwindV4SourceCss && require_v4_engine.hasTailwindSourceDirectives(readCurrentProcessedRawSource(), { importFallback: true });
|
|
1742
1887
|
const shouldPreserveFinalWebCssAsset = isWebGeneratorTarget && processedSourceFile === void 0 && !shouldForceConfiguredMainCssGeneration && (hasGeneratedCssMarker || hasTailwindGeneratedAssetCss);
|
|
1743
|
-
const shouldSkipKnownProcessedCssAsset = !shouldForceConfiguredMainCssGeneration && !shouldRegenerateProcessedTailwindV4SourceCss && !shouldRegenerateStaleProcessedWebCssAsset && (processedCssAssetKnown || isWebpackProcessedCssAsset?.(file, readCurrentProcessedRawSource(), processedCssAssetMetadata)) && !hasProcessedMainAssetUserCss && (!cssHandlerOptionsForProcessedAsset.isMainChunk || hasGeneratedCssMarker || hasTailwindGeneratedAssetCss);
|
|
1888
|
+
const shouldSkipKnownProcessedCssAsset = !shouldForceConfiguredMainCssGeneration && !shouldRegenerateProcessedTailwindV4SourceCss && !shouldRegenerateStaleProcessedWebCssAsset && (processedCssAssetKnown || isWebpackProcessedCssAsset?.(file, readCurrentProcessedRawSource(), processedCssAssetMetadata)) && !hasProcessedMainAssetUserCss && !hasProcessedLoaderGeneratedUserCss && (!cssHandlerOptionsForProcessedAsset.isMainChunk || hasGeneratedCssMarker || hasTailwindGeneratedAssetCss);
|
|
1744
1889
|
const shouldSkipProcessedCssAsset = cachedSkipProcessedCssAsset ?? (shouldFinalizeProcessedWebCssAsset || shouldPreserveFinalWebCssAsset || shouldSkipKnownProcessedCssAsset);
|
|
1745
1890
|
if (processedCssAssetKnown && cachedSkipProcessedCssAsset === void 0 && !shouldFinalizeProcessedWebCssAsset && !shouldPreserveFinalWebCssAsset) processedCssAssetSkipDecisionCache.set(processedCssDecisionCacheKey, shouldSkipProcessedCssAsset === true);
|
|
1746
1891
|
if (shouldSkipProcessedCssAsset) {
|
|
@@ -1765,12 +1910,29 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1765
1910
|
},
|
|
1766
1911
|
transform: async () => {
|
|
1767
1912
|
const source = readCurrentProcessedRawSource();
|
|
1913
|
+
const processedBareSelectorSourceCss = processedSourceCss ?? (hasTailwindGeneratedAssetCss ? removeWebpackTailwindGeneratedAssetCss(source) : void 0);
|
|
1768
1914
|
const nextCss = stripTrailingLineWhitespace(finalizeCssAssetSource(hasTailwindGeneratedAssetCss && !hasGeneratedCssMarker ? isWebGeneratorTarget ? source : (await compilerOptions.styleHandler(source, cssHandlerOptionsForProcessedAsset)).css : source, {
|
|
1769
1915
|
cssPreflight: cssHandlerOptionsForProcessedAsset.isMainChunk,
|
|
1770
1916
|
generatedCss: hasGeneratedCssMarker || hasTailwindGeneratedAssetCss
|
|
1771
1917
|
}));
|
|
1918
|
+
const processedSourceBareUserCss = isWebGeneratorTarget || processedBareSelectorSourceCss === void 0 ? void 0 : createWebpackGeneratorUserCssSourceAppend({
|
|
1919
|
+
css: collectWebpackBareSelectorUserCss(processedBareSelectorSourceCss),
|
|
1920
|
+
processed: false
|
|
1921
|
+
});
|
|
1922
|
+
const finalizedProcessedSourceBareUserCss = processedSourceBareUserCss === void 0 ? "" : finalizeCssAssetSource(processedSourceBareUserCss.css, {
|
|
1923
|
+
cssPreflight: false,
|
|
1924
|
+
generatedCss: false
|
|
1925
|
+
});
|
|
1926
|
+
const missingProcessedSourceBareUserCss = finalizedProcessedSourceBareUserCss.trim().length === 0 ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(nextCss, finalizedProcessedSourceBareUserCss);
|
|
1927
|
+
const css = missingProcessedSourceBareUserCss.trim().length === 0 ? nextCss : createWebpackGeneratorUserCssSourceAppend({
|
|
1928
|
+
css: nextCss,
|
|
1929
|
+
processed: true
|
|
1930
|
+
}, {
|
|
1931
|
+
css: missingProcessedSourceBareUserCss,
|
|
1932
|
+
processed: true
|
|
1933
|
+
}).css;
|
|
1772
1934
|
debug("css skip webpack-loader-pipeline asset: %s", file);
|
|
1773
|
-
return { result: new ConcatSource(finalizeTracedCss(
|
|
1935
|
+
return { result: new ConcatSource(finalizeTracedCss(css, cssHandlerOptionsForProcessedAsset)) };
|
|
1774
1936
|
}
|
|
1775
1937
|
});
|
|
1776
1938
|
}, cssTaskFactories);
|
|
@@ -1839,7 +2001,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1839
2001
|
const loaderGeneratedCss = sourceFile && !isWebGeneratorTarget ? generatedCssSources.get(node_path.default.resolve(sourceFile)) : void 0;
|
|
1840
2002
|
const sourceCss = sourceFile ? cssSources.get(node_path.default.resolve(sourceFile))?.css : void 0;
|
|
1841
2003
|
const shouldRegenerateExplicitTailwindV4CssSource = sourceCss !== void 0 && (require_v4_engine.hasTailwindSourceDirectives(sourceCss, { importFallback: true }) || sourceCss.includes("@config"));
|
|
1842
|
-
|
|
2004
|
+
const explicitTailwindV4SourceCandidates = shouldRegenerateExplicitTailwindV4CssSource && sourceCss && sourceFile && webpackSourceCandidates?.getSourceCandidatesForEntries ? await require_tailwindcss.resolveTailwindV4EntriesFromCssCached(sourceCss, node_path.default.dirname(sourceFile)).then((resolved) => resolved?.entries ? webpackSourceCandidates.getSourceCandidatesForEntries(resolved.entries) : void 0) : void 0;
|
|
2005
|
+
if (loaderGeneratedCss && shouldConsumeWebpackLoaderGeneratedCss({
|
|
2006
|
+
hasBundlerGeneratedCssMarker: require_source_candidate_scan_signature.hasBundlerGeneratedCssMarker(currentRawSource),
|
|
2007
|
+
loaderGeneratedClassSet: loaderGeneratedCss.classSet,
|
|
2008
|
+
sourceCandidates: explicitTailwindV4SourceCandidates,
|
|
2009
|
+
shouldRegenerateExplicitTailwindV4CssSource,
|
|
2010
|
+
watchMode
|
|
2011
|
+
})) {
|
|
1843
2012
|
for (const className of loaderGeneratedCss.classSet) {
|
|
1844
2013
|
generatorRuntimeSet.add(className);
|
|
1845
2014
|
transformRuntimeSet.add(className);
|
|
@@ -1848,16 +2017,49 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1848
2017
|
const currentRawSourceWithoutBundlerMarkers = require_source_candidate_scan_signature.stripBundlerGeneratedCssMarkers(currentRawSource);
|
|
1849
2018
|
const currentAssetHasProcessedUrl = hasProcessedCssAssetUrl(currentRawSourceWithoutBundlerMarkers) && currentRawSourceWithoutBundlerMarkers !== loaderGeneratedCss.css;
|
|
1850
2019
|
const currentAssetUserCss = currentAssetHasProcessedUrl ? currentRawSourceWithoutBundlerMarkers : shouldUseWebpackAssetAsGeneratorUserCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css, { processed: true }) ? require_hmr_timing.removeGeneratedSelectorCompatCss(currentRawSourceWithoutBundlerMarkers, loaderGeneratedCss.css) : void 0;
|
|
1851
|
-
const
|
|
1852
|
-
|
|
2020
|
+
const isConfiguredMainCssSource = configuredMainCssEntryFiles.some((entry) => node_path.default.resolve(entry) === node_path.default.resolve(sourceFile));
|
|
2021
|
+
const loaderGeneratedCssWithoutMarkers = require_source_candidate_scan_signature.stripBundlerGeneratedCssMarkers(loaderGeneratedCss.css);
|
|
2022
|
+
const currentAssetUserCssWithoutMarkers = currentAssetUserCss === void 0 ? "" : require_source_candidate_scan_signature.stripBundlerGeneratedCssMarkers(currentAssetUserCss);
|
|
2023
|
+
const currentAssetMissingUserCss = !(currentAssetUserCssWithoutMarkers.trim().length > 0 && !require_v4_engine.isCommentOnlyCss(currentAssetUserCssWithoutMarkers)) ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCssWithoutMarkers, loaderGeneratedCssWithoutMarkers);
|
|
2024
|
+
if (isConfiguredMainCssSource && !cssHandlerOptions.isMainChunk && (currentAssetMissingUserCss.trim().length === 0 || require_v4_engine.isCommentOnlyCss(currentAssetMissingUserCss))) {
|
|
2025
|
+
debug("css skip duplicate webpack loader main generation: %s <- %s", file, sourceFile);
|
|
2026
|
+
return { result: new ConcatSource(finalizeTracedCss("", cssHandlerOptions)) };
|
|
2027
|
+
}
|
|
2028
|
+
const finalizedLoaderCss = finalizeCssAssetSource(currentAssetUserCss === void 0 ? loaderGeneratedCss.css : createWebpackGeneratorUserCssSourceAppend({
|
|
2029
|
+
css: currentAssetUserCss === void 0 ? loaderGeneratedCss.css : currentAssetHasProcessedUrl ? require_hmr_timing.removeGeneratedSelectorCompatCss(loaderGeneratedCss.css, currentAssetUserCss) : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(currentAssetUserCss, loaderGeneratedCss.css),
|
|
1853
2030
|
processed: true
|
|
1854
|
-
}, {
|
|
2031
|
+
}, currentAssetUserCss === void 0 ? void 0 : {
|
|
1855
2032
|
css: currentAssetUserCss,
|
|
1856
2033
|
processed: true
|
|
1857
2034
|
}).css, {
|
|
1858
2035
|
cssPreflight: cssHandlerOptions.isMainChunk,
|
|
1859
2036
|
generatedCss: true
|
|
1860
|
-
})
|
|
2037
|
+
});
|
|
2038
|
+
const loaderSourceBareUserCss = isWebGeneratorTarget ? void 0 : createWebpackGeneratorUserCssSourceAppend(...[currentAssetUserCss === void 0 ? void 0 : {
|
|
2039
|
+
css: currentAssetUserCss,
|
|
2040
|
+
processed: true
|
|
2041
|
+
}, sourceCss === void 0 ? void 0 : {
|
|
2042
|
+
css: sourceCss,
|
|
2043
|
+
processed: false
|
|
2044
|
+
}].map((source) => {
|
|
2045
|
+
if (source === void 0) return;
|
|
2046
|
+
return {
|
|
2047
|
+
css: collectWebpackBareSelectorUserCss(source.css),
|
|
2048
|
+
processed: source.processed
|
|
2049
|
+
};
|
|
2050
|
+
}));
|
|
2051
|
+
const finalizedLoaderSourceBareUserCss = loaderSourceBareUserCss === void 0 ? "" : finalizeCssAssetSource(loaderSourceBareUserCss.css, {
|
|
2052
|
+
cssPreflight: false,
|
|
2053
|
+
generatedCss: false
|
|
2054
|
+
});
|
|
2055
|
+
const missingLoaderSourceBareUserCss = finalizedLoaderSourceBareUserCss.trim().length === 0 ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(finalizedLoaderCss, finalizedLoaderSourceBareUserCss);
|
|
2056
|
+
const css = finalizeTracedCss(missingLoaderSourceBareUserCss.trim().length === 0 ? finalizedLoaderCss : createWebpackGeneratorUserCssSourceAppend({
|
|
2057
|
+
css: finalizedLoaderCss,
|
|
2058
|
+
processed: true
|
|
2059
|
+
}, {
|
|
2060
|
+
css: missingLoaderSourceBareUserCss,
|
|
2061
|
+
processed: true
|
|
2062
|
+
}).css, cssHandlerOptions);
|
|
1861
2063
|
debug("css consume webpack loader generation: %s <- %s", file, sourceFile);
|
|
1862
2064
|
return { result: new ConcatSource(css) };
|
|
1863
2065
|
}
|
|
@@ -1948,7 +2150,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1948
2150
|
generated = void 0;
|
|
1949
2151
|
}
|
|
1950
2152
|
else debug("css generator skipped for unmatched webpack main css asset: %s", file);
|
|
1951
|
-
const
|
|
2153
|
+
const finalizedGeneratedCss = generated ? finalizeCssAssetSource(isWebGeneratorTarget && currentRawSource.includes("tailwindcss v4.") ? createWebpackGeneratorUserCssSourceAppend({
|
|
1952
2154
|
css: generated.css,
|
|
1953
2155
|
processed: true
|
|
1954
2156
|
}, {
|
|
@@ -1957,7 +2159,36 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1957
2159
|
})?.css ?? generated.css : generated.css, {
|
|
1958
2160
|
cssPreflight: cssHandlerOptions.isMainChunk,
|
|
1959
2161
|
generatedCss: true
|
|
1960
|
-
}) : isWebGeneratorTarget ? finalizeCssAssetSource(generatorRawSource, { generatedCss: false }) : finalizeCssAssetSource((await compilerOptions.styleHandler(generatorRawSource, cssHandlerOptions)).css, { generatedCss: false })
|
|
2162
|
+
}) : isWebGeneratorTarget ? finalizeCssAssetSource(generatorRawSource, { generatedCss: false }) : finalizeCssAssetSource((await compilerOptions.styleHandler(generatorRawSource, cssHandlerOptions)).css, { generatedCss: false });
|
|
2163
|
+
const sourceBareUserCss = isWebGeneratorTarget ? void 0 : createWebpackGeneratorUserCssSourceAppend(...[
|
|
2164
|
+
userRawSource,
|
|
2165
|
+
sourceCss === void 0 ? void 0 : {
|
|
2166
|
+
css: sourceCss,
|
|
2167
|
+
processed: sourceCssProcessed
|
|
2168
|
+
},
|
|
2169
|
+
{
|
|
2170
|
+
css: generatorRawSource,
|
|
2171
|
+
processed: false
|
|
2172
|
+
}
|
|
2173
|
+
].map((source) => {
|
|
2174
|
+
if (source === void 0) return;
|
|
2175
|
+
return {
|
|
2176
|
+
css: collectWebpackBareSelectorUserCss(source.css),
|
|
2177
|
+
processed: source.processed
|
|
2178
|
+
};
|
|
2179
|
+
}));
|
|
2180
|
+
const finalizedSourceBareUserCss = sourceBareUserCss === void 0 ? "" : finalizeCssAssetSource(sourceBareUserCss.css, {
|
|
2181
|
+
cssPreflight: false,
|
|
2182
|
+
generatedCss: false
|
|
2183
|
+
});
|
|
2184
|
+
const missingSourceBareUserCss = finalizedSourceBareUserCss.trim().length === 0 ? "" : (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(finalizedGeneratedCss, finalizedSourceBareUserCss);
|
|
2185
|
+
const source = new ConcatSource(finalizeTracedCss(missingSourceBareUserCss.trim().length === 0 ? finalizedGeneratedCss : createWebpackGeneratorUserCssSourceAppend({
|
|
2186
|
+
css: finalizedGeneratedCss,
|
|
2187
|
+
processed: true
|
|
2188
|
+
}, {
|
|
2189
|
+
css: missingSourceBareUserCss,
|
|
2190
|
+
processed: true
|
|
2191
|
+
}).css, cssHandlerOptions));
|
|
1961
2192
|
if (generated) {
|
|
1962
2193
|
for (const className of generated.classSet) generatorRuntimeSet.add(className);
|
|
1963
2194
|
debug("css handle via tailwind v%s engine(%s): %s", runtimeState.tailwindRuntime.majorVersion, generated.target, file);
|
|
@@ -2158,6 +2389,13 @@ function setupWebpackV5Loaders(options) {
|
|
|
2158
2389
|
const debug = require_context.createDebug();
|
|
2159
2390
|
const weappTailwindcssPackageDir = require_source_candidate_scan_signature.resolvePackageDir("weapp-tailwindcss");
|
|
2160
2391
|
const outputIgnoredPredicatePath = Symbol("weapp-tailwindcss.outputIgnoredPredicatePath");
|
|
2392
|
+
function shouldKeepPreviousWebpackCssSource(previous, next) {
|
|
2393
|
+
if (next.processed === true && previous.processed === false) return true;
|
|
2394
|
+
if (previous.processed === true || next.processed === true || !previous.css || !next.css || previous.css === next.css) return false;
|
|
2395
|
+
const previousMarkers = collectWebpackAssetUserCssMarkers(previous.css);
|
|
2396
|
+
const nextMarkers = collectWebpackAssetUserCssMarkers(next.css);
|
|
2397
|
+
return previousMarkers.size > nextMarkers.size && [...nextMarkers].every((marker) => previousMarkers.has(marker));
|
|
2398
|
+
}
|
|
2161
2399
|
function normalizeIgnoredList(ignored) {
|
|
2162
2400
|
return (Array.isArray(ignored) ? [...ignored] : [ignored]).filter((item) => typeof item === "string" || item instanceof RegExp || typeof item === "function");
|
|
2163
2401
|
}
|
|
@@ -2335,14 +2573,15 @@ var WeappTailwindcss = class {
|
|
|
2335
2573
|
const registerWebpackCssSourceFile = (source) => {
|
|
2336
2574
|
const file = node_path.default.resolve(source.file);
|
|
2337
2575
|
const previous = webpackCssSources.get(file);
|
|
2338
|
-
|
|
2576
|
+
const next = {
|
|
2577
|
+
css: typeof source.css === "string" ? require_v4_engine.normalizeTailwindConfigDirectives(source.css, node_path.default.dirname(file)) : source.css,
|
|
2578
|
+
processed: source.processed
|
|
2579
|
+
};
|
|
2580
|
+
if (previous && shouldKeepPreviousWebpackCssSource(previous, next)) {
|
|
2339
2581
|
currentWebpackCssSourceFiles.add(file);
|
|
2340
2582
|
return;
|
|
2341
2583
|
}
|
|
2342
|
-
webpackCssSources.set(file,
|
|
2343
|
-
css: typeof source.css === "string" ? require_v4_engine.normalizeTailwindConfigDirectives(source.css, node_path.default.dirname(file)) : source.css,
|
|
2344
|
-
processed: source.processed
|
|
2345
|
-
});
|
|
2584
|
+
webpackCssSources.set(file, next);
|
|
2346
2585
|
currentWebpackCssSourceFiles.add(file);
|
|
2347
2586
|
};
|
|
2348
2587
|
const registerWebpackGeneratedCss = (source) => {
|