weapp-tailwindcss 5.5.6 → 5.5.8
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/{auto-DtU6f3X6.cjs → auto-B1OyRrE8.cjs} +1 -1
- package/dist/{auto-2dg_uhEJ.js → auto-ENr4xzzw.js} +1 -1
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -5
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/framework-css-composition.d.ts +1 -1
- package/dist/bundlers/shared/framework-postcss.d.ts +1 -25
- package/dist/bundlers/shared/framework-user-css.d.ts +1 -4
- package/dist/bundlers/shared/generated-css-marker.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/candidates.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +1 -11
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -25
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +1 -19
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +1 -23
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +1 -30
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +1 -12
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/markers.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +1 -8
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +1 -60
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -21
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +1 -33
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -14
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -16
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +1 -22
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/types.d.ts +1 -64
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -7
- package/dist/bundlers/shared/generator-css.d.ts +1 -9
- package/dist/bundlers/shared/run-tasks.d.ts +1 -3
- package/dist/bundlers/shared/runtime-class-set.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/collector.d.ts +1 -8
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/snapshot.d.ts +1 -19
- package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/store.d.ts +1 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -75
- package/dist/bundlers/shared/source-candidates/views.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates.d.ts +1 -4
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +1 -18
- package/dist/bundlers/shared/source-scan/dependencies.d.ts +1 -2
- package/dist/bundlers/shared/source-scan.d.ts +1 -16
- package/dist/bundlers/shared/static-config-content.d.ts +1 -5
- package/dist/bundlers/shared/style-handler-options.d.ts +1 -7
- package/dist/bundlers/shared/style-requests.d.ts +1 -5
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -20
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +2 -2
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +1 -12
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +1 -4
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +4 -7
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -13
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -2
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +4 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +6 -0
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/source.d.ts +29 -0
- package/dist/{cache-CBJFB1HN.cjs → cache-CzvIGfwS.cjs} +1 -0
- package/dist/compiler/composition.d.ts +1 -1
- package/dist/compiler/runtime-affecting-signature/js.d.ts +1 -0
- package/dist/compiler/semantic-css.d.ts +1 -1
- package/dist/compiler/types.d.ts +1 -1
- package/dist/{compiler-D3GBwxoa.js → compiler-CThodfGH.js} +3098 -3067
- package/dist/{compiler-C8FqI-P3.cjs → compiler-DbwS3329.cjs} +20979 -20870
- package/dist/core/compiler/generation-cache.d.ts +4 -2
- package/dist/core/compiler/types.d.ts +1 -1
- package/dist/core.cjs +7 -7
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{css-imports-XvtI1zCY.cjs → css-imports-R_RDMjPz.cjs} +7 -21
- package/dist/css-macro/auto.d.ts +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +2 -2
- package/dist/css-macro.js +1 -1
- package/dist/final-css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{final-css-cleanup-u_sI2p56.js → final-css-cleanup-BOzhuhGz.js} +3 -2
- package/dist/framework.cjs +1 -1
- package/dist/{v4-generation-core-Cz1D7wm1.cjs → generated-css-marker-B0RyziOH.cjs} +638 -1546
- package/dist/generation/candidates.d.ts +1 -0
- package/dist/generation/class-selectors.d.ts +4 -0
- package/dist/generation/config-directive.d.ts +1 -0
- package/dist/generation/directives/fallback.d.ts +1 -0
- package/dist/generation/directives.d.ts +1 -0
- package/dist/generation/framework-css-composition.d.ts +1 -0
- package/dist/generation/framework-postcss.d.ts +25 -0
- package/dist/generation/framework-user-css.d.ts +5 -0
- package/dist/generation/generation-helpers/preflight.d.ts +19 -0
- package/dist/generation/generation-helpers/results.d.ts +23 -0
- package/dist/generation/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/generation/generation-helpers/source-order.d.ts +1 -0
- package/dist/generation/generation-helpers.d.ts +4 -0
- package/dist/generation/index.d.ts +9 -0
- package/dist/generation/legacy-compat.d.ts +12 -0
- package/dist/generation/legacy-selectors.d.ts +1 -0
- package/dist/generation/legacy-units.d.ts +1 -0
- package/dist/generation/local-imports.d.ts +1 -0
- package/dist/generation/markers.d.ts +1 -0
- package/dist/generation/output-import-shell.d.ts +1 -0
- package/dist/generation/pipeline/context.d.ts +60 -0
- package/dist/generation/pipeline/deferred-output.d.ts +3 -0
- package/dist/generation/pipeline/execution.d.ts +3 -0
- package/dist/generation/pipeline/fallback-output.d.ts +3 -0
- package/dist/generation/pipeline/ordered-output.d.ts +3 -0
- package/dist/generation/pipeline/preparation.d.ts +19 -0
- package/dist/generation/pipeline.d.ts +2 -0
- package/dist/generation/result-helpers.d.ts +6 -0
- package/dist/generation/scoped-rules.d.ts +1 -0
- package/dist/generation/service.d.ts +20 -0
- package/dist/generation/source-files.d.ts +21 -0
- package/dist/generation/source-resolver/apply-reference.d.ts +10 -0
- package/dist/generation/source-resolver/config.d.ts +7 -0
- package/dist/generation/source-resolver/configuration.d.ts +33 -0
- package/dist/generation/source-resolver/matching.d.ts +3 -0
- package/dist/generation/source-resolver/metadata.d.ts +28 -0
- package/dist/generation/source-resolver/postcss-source.d.ts +14 -0
- package/dist/generation/source-resolver/resolve-source.d.ts +4 -0
- package/dist/generation/source-resolver/resolve-sources.d.ts +5 -0
- package/dist/generation/source-resolver/single-source.d.ts +16 -0
- package/dist/generation/source-resolver/source-entries.d.ts +3 -0
- package/dist/generation/source-resolver/source-matching.d.ts +5 -0
- package/dist/generation/source-resolver/types.d.ts +22 -0
- package/dist/generation/source-resolver.d.ts +7 -0
- package/dist/generation/style-options.d.ts +8 -0
- package/dist/generation/style-requests.d.ts +5 -0
- package/dist/generation/types.d.ts +65 -0
- package/dist/generation/user-css/apply-only.d.ts +5 -0
- package/dist/generation/user-css/at-rules.d.ts +1 -0
- package/dist/generation/user-css/compile-functions.d.ts +3 -0
- package/dist/generation/user-css/generated-cleanup.d.ts +1 -0
- package/dist/generation/user-css/source-fragments.d.ts +1 -0
- package/dist/generation/user-css/transform.d.ts +1 -0
- package/dist/generation/user-css/user-layers.d.ts +1 -0
- package/dist/generation/user-css.d.ts +5 -0
- package/dist/generation/user-layer-order.d.ts +1 -0
- package/dist/generation/validate.d.ts +7 -0
- package/dist/generator-CxauQbx3.cjs +1868 -0
- package/dist/generator-oKZ5mCJ5.js +1637 -0
- package/dist/generator.cjs +10 -4
- package/dist/generator.js +1 -1
- package/dist/{gulp-BExe5RBF.cjs → gulp-CngHA9cU.cjs} +27 -26
- package/dist/{gulp-BhkIIk7J.js → gulp-DhddVxGA.js} +6 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-CoiJIqDu.cjs → hmr-timing-Dc4c1VRg.cjs} +13 -13
- package/dist/{hmr-timing-B9Yt86-U.js → hmr-timing-xPpat-km.js} +518 -1360
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/js/ModuleGraph.d.ts +3 -1
- package/dist/js/babel/analyze.d.ts +6 -0
- package/dist/js/babel.d.ts +1 -2
- package/dist/js/fast-path/analysis.d.ts +14 -0
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/oxc-parser.d.ts +4 -0
- package/dist/pipeline-helpers-EUud9R2K.cjs +516 -0
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +3 -2
- package/dist/postcss.d.ts +1 -1
- package/dist/postcss.js +3 -2
- package/dist/presets.cjs +3 -3
- package/dist/presets.js +2 -2
- package/dist/project-sources/candidates/collector.d.ts +8 -0
- package/dist/project-sources/candidates/scan-root.d.ts +12 -0
- package/dist/project-sources/candidates/script.d.ts +1 -0
- package/dist/project-sources/candidates/snapshot.d.ts +19 -0
- package/dist/project-sources/candidates/source-priority.d.ts +1 -0
- package/dist/project-sources/candidates/store.d.ts +2 -0
- package/dist/project-sources/candidates/types-and-cache.d.ts +75 -0
- package/dist/project-sources/candidates/views.d.ts +12 -0
- package/dist/project-sources/candidates.d.ts +4 -0
- package/dist/project-sources/css-entries.d.ts +18 -0
- package/dist/project-sources/dependencies.d.ts +2 -0
- package/dist/project-sources/index.d.ts +16 -0
- package/dist/project-sources/static-config-content.d.ts +5 -0
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-Ctb5zv51.cjs → rolldown-runtime-fg3euq-1.cjs} +7 -0
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.js +2 -2
- package/dist/{runtime-state-XYSycuGu.cjs → runtime-state-BOzuVoKl.cjs} +1 -1
- package/dist/{scoped-generator-B6Y1bxzM.js → scoped-generator-DlQrVbuC.js} +7 -6
- package/dist/{scoped-generator-BUBls_oM.cjs → scoped-generator-lbTwL6mD.cjs} +9 -9
- package/dist/{source-candidate-scan-signature-DNuGKTqf.js → source-candidate-scan-signature-BjVQYL-C.js} +3 -3
- package/dist/{source-candidate-scan-signature-BtJZp28T.cjs → source-candidate-scan-signature-nG-rg809.cjs} +4 -4
- package/dist/style-injector/internal.d.ts +35 -35
- package/dist/style-injector/options.d.ts +1 -1
- package/dist/tailwindcss/miniprogram.d.ts +1 -1
- package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -1
- package/dist/tailwindcss/source-scan/inline-source.d.ts +1 -7
- package/dist/tailwindcss/source-scan.d.ts +3 -32
- package/dist/tailwindcss/v4/css-sources.d.ts +1 -1
- package/dist/tailwindcss/v4/preflight.d.ts +1 -3
- package/dist/tailwindcss/v4/rpx-theme-warning.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +2 -3
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +1 -6
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +5 -2
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +3 -7
- package/dist/tailwindcss/v4-engine/source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/types.d.ts +3 -1
- package/dist/{tailwindcss-CBYjzRmV.cjs → tailwindcss-U3KIUegn.cjs} +65 -264
- package/dist/{tailwindcss-B_4E52WF.js → tailwindcss-kSd0ykiX.js} +71 -243
- package/dist/{transform-CkEnJYIP.js → transform-BAon9ykq.js} +25 -16
- package/dist/{transform-FkqbTBJR.cjs → transform-DVg4q8hh.cjs} +32 -23
- package/dist/types/index.d.ts +2 -2
- package/dist/types/user-defined-options/general.d.ts +1 -1
- package/dist/uni-app-x/border-preflight.d.ts +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +3 -1
- package/dist/uni-app-x/vite/style-result.d.ts +1 -1
- package/dist/utils/run-tasks.d.ts +3 -0
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-lP35OguX.js → vite-D-RGkmOE.js} +62 -674
- package/dist/{vite-DxuKPZlp.cjs → vite-IX83wh_L.cjs} +217 -828
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-GbC14Rlt.cjs → watch-dependencies-C1so1whD.cjs} +14 -1
- package/dist/weapp-tw-css-generation-loader.cjs +4 -3
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +33 -28
- package/dist/weapp-tw-runtime-classset-loader.cjs +5 -18
- package/dist/{web-Dfz_jpNj.js → web--kA4HUTm.js} +16 -115
- package/dist/{web-DhDxhlkq.cjs → web-DHfZ_KC9.cjs} +83 -192
- package/dist/{webpack-R2Sbggiy.cjs → webpack-BetjemzT.cjs} +87 -87
- package/dist/{webpack-D6jp1o3m.js → webpack-Bhkd27Rs.js} +28 -441
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +12 -7
- package/dist/final-css-cleanup-CDTmVAye.cjs +0 -1
- package/dist/generator-Bvr4WmuF.cjs +0 -3891
- package/dist/generator-C0BJjyLM.js +0 -3343
- package/dist/pipeline-helpers-BOjTEmMi.cjs +0 -971
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature, v as source_scan_exports } from "./tailwindcss-kSd0ykiX.js";
|
|
2
|
+
import { L as getTailwindV4IncrementalGenerateCacheStats, N as _defineProperty, _ as upsertTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveTailwindcssOptions, o as resolveRuntimeBranch } from "./generator-oKZ5mCJ5.js";
|
|
3
3
|
import { r as getGroupedEntries } from "./utils-MVwpU07P.js";
|
|
4
|
-
import { A as
|
|
5
|
-
import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, T as refreshTailwindRuntimeState, Y as md5Hash, a as beginCompilerShadowRun, f as getCompilerContext, h as pluginName, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, m as resolveStyleOptionsFromContext, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-D3GBwxoa.js";
|
|
4
|
+
import { A as createTailwindRuntimeReadyPromise, G as createCompilationDependencyChanges, I as AssetEmissionPlan, M as refreshTailwindRuntimeState, N as createDebug, V as recordCompilationDependencyChanges, a as beginCompilerShadowRun, f as getCompilerContext, h as pluginName, i as disposeCompilerOwner, j as ensureRuntimeClassSet, m as resolveStyleOptionsFromContext, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, q as md5Hash, t as createCompilerRuntimeState, y as shouldSkipJsTransform, z as getCompilationScopeDependencyRevision } from "./compiler-CThodfGH.js";
|
|
6
5
|
import { n as getDefaultCssPreflight } from "./defaults-AQuvJS-h.js";
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { A as stripTailwindSourceMediaFragments, D as isCommentOnlyCss, F as collectFrameworkPostcssOptionsFromLoaderEntries, G as createEscapeFragments, H as stripRequestQuery, I as hasTailwindGeneratedCss, K as isPureLocalCssImportWrapper, L as hasTailwindGeneratedCssMarkers, O as removeMiniProgramInteractiveSelectors, P as captureResolvedFrameworkPostcssOptions, S as removeGeneratedSelectorCompatCss, U as createRuntimeClassSetManager, V as isSourceStyleRequest, W as collectStrictEscapedRuntimeCandidates, X as createSourceCandidateStore, Z as isSourceCandidateRequest, _ as resolveTaskConcurrency, a as hasBundlerGeneratedCssMarker, at as hasTailwindSourceDirectives, c as annotateCssSourceTrace, ct as parseImportRequest, d as isCssSourceTraceEnabled, dt as finalizeCompilerShadowRun, et as resolveSourceCandidateScanFiles, f as generateTailwindV4Css, g as pushConcurrentTaskFactories, h as collectRawSourceClassSelectors, it as hasTailwindRootDirectives, j as stripUnmatchedTailwindSourceMediaCloseFragments, k as removeTailwindV4GeneratorAtRules, l as createCssSourceTraceCacheSignature, lt as removeTailwindSourceDirectives, n as emitHmrTiming, nt as hasTailwindApplyDirective, ot as normalizeTailwindConfigDirectives$1, s as stripBundlerGeneratedCssMarkers, u as createCssTokenSourceMap, x as scoreTailwindV4CssSourceFileMatch, z as hasMiniProgramTailwindV4PreflightReset } from "./hmr-timing-xPpat-km.js";
|
|
7
|
+
import { a as createRuntimeCompilationBuildState, c as updateRuntimeCompilationBuildState, i as createRuntimeCompilationAffectingSignature, n as processCachedTask, r as buildRuntimeCompilationSnapshot, s as resetRuntimeCompilationBuildState, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-BOzhuhGz.js";
|
|
8
|
+
import { _ as createBuiltinWebpackStyleInjectorPlugin, c as createCandidateSignature, h as resolvePluginDisabledState, i as finalizeMiniProgramCss$1, m as classifyRuntimeEntry, n as createScopedGeneratorRuntime, o as pruneMiniProgramGeneratedCss, s as stripMiniProgramCssSpecificityPlaceholders, x as resolveWebpackFrameworkProfile, y as webpackStyleInjectorDelegates } from "./scoped-generator-DlQrVbuC.js";
|
|
9
|
+
import { a as toAbsoluteOutputPath, i as resolveOutputSpecifier, n as resolvePackageDir, t as createSourceCandidateScanSignature } from "./source-candidate-scan-signature-BjVQYL-C.js";
|
|
10
10
|
import Module, { createRequire } from "node:module";
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import process from "node:process";
|
|
14
|
-
import { dedupeCoveredCssRules, filterExistingCssRules,
|
|
14
|
+
import { collectGeneratedCssClassCandidates, collectWebpackAssetUserCssMarkers, collectWebpackBareSelectorUserCss, composeProcessedCssSources as createWebpackGeneratorUserCssSourceAppend, dedupeCoveredCssRules, dedupeMiniProgramPreflightSelectorRules, ensureWebpackMiniProgramTwContentInit, filterExistingCssRules, hasAdditionalWebpackAssetUserCssMarkers, hasMiniProgramPreflightSelector, hasMiniProgramPreflightSelector as hasMiniProgramPreflightSelector$1, hasWebpackTailwindSourceDirectives, isOnlyWebpackTailwindGeneratedPreflightCss, isWebpackCssSourceRepresentedInAsset, postcss, removeMiniProgramPreflightSelectorRule, removeTailwindV4StandaloneHostPreflightRule, removeWebpackGeneratorNonTailwindImports, removeWebpackTailwindGeneratedAssetCss, stripTrailingLineWhitespace } from "@weapp-tailwindcss/postcss/transform";
|
|
15
15
|
import { readFile, stat } from "node:fs/promises";
|
|
16
|
-
import micromatch from "micromatch";
|
|
17
16
|
import { MappingChars2String } from "@weapp-core/escape";
|
|
18
17
|
import { fileURLToPath } from "node:url";
|
|
18
|
+
import micromatch from "micromatch";
|
|
19
19
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/shared.ts
|
|
20
20
|
function getCacheKey(filename) {
|
|
21
21
|
return filename;
|
|
@@ -159,347 +159,18 @@ function isRuntimeTransformCandidate(candidate) {
|
|
|
159
159
|
return candidate.length > 0 && !candidate.includes("=") && !candidate.includes("<") && !candidate.includes(">") && !candidate.includes("${");
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.ts
|
|
163
|
-
function collectWebpackAssetUserCssMarkers(source) {
|
|
164
|
-
const markers = /* @__PURE__ */ new Set();
|
|
165
|
-
for (const match of source.matchAll(/\.((?:\\.|[_a-z\u00A0-\uFFFF-])(?:\\.|[\w\u00A0-\uFFFF-])*)/gi)) markers.add(`class:${match[1]}`);
|
|
166
|
-
for (const match of source.matchAll(/@(?:-[\w-]+-)?keyframes\s+((?:\\.|[-\w\u00A0-\uFFFF])+)/gi)) markers.add(`keyframes:${match[1]}`);
|
|
167
|
-
try {
|
|
168
|
-
const root = postcss.parse(source);
|
|
169
|
-
root.walkRules((rule) => {
|
|
170
|
-
for (const selector of rule.selectors) if (!/(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i.test(selector)) markers.add(`selector:${selector.trim().replace(/\s+/g, " ")}`);
|
|
171
|
-
rule.walkDecls((decl) => {
|
|
172
|
-
if (decl.prop.startsWith("--")) markers.add(`custom-property:${decl.prop}`);
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
root.walkAtRules("font-face", (rule) => {
|
|
176
|
-
rule.walkDecls("font-family", (decl) => {
|
|
177
|
-
markers.add(`font-face:${decl.value.trim()}`);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
} catch {}
|
|
181
|
-
return markers;
|
|
182
|
-
}
|
|
183
|
-
//#endregion
|
|
184
162
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.ts
|
|
185
|
-
const WEBPACK_TAILWIND_GENERATED_LAYER_NAMES = /* @__PURE__ */ new Set([
|
|
186
|
-
"theme",
|
|
187
|
-
"base",
|
|
188
|
-
"utilities"
|
|
189
|
-
]);
|
|
190
|
-
const WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE = /(?:^|[^\w-])\.[^,{]{0,512}(?:\\:|\\\[|\\#)/;
|
|
191
|
-
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)(?:[\-\\{]|$)|\\\[)/;
|
|
192
|
-
const WEBPACK_TAILWIND_BANNER_RE = /tailwindcss v4\./;
|
|
193
|
-
const WEBPACK_TAILWIND_PREFLIGHT_SELECTORS = /* @__PURE__ */ new Set([
|
|
194
|
-
"*",
|
|
195
|
-
":after",
|
|
196
|
-
":before",
|
|
197
|
-
"::after",
|
|
198
|
-
"::before",
|
|
199
|
-
"::backdrop",
|
|
200
|
-
"view",
|
|
201
|
-
"text"
|
|
202
|
-
]);
|
|
203
|
-
const WEBPACK_TAILWIND_PREFLIGHT_PROPS = /* @__PURE__ */ new Set([
|
|
204
|
-
"box-sizing",
|
|
205
|
-
"border",
|
|
206
|
-
"border-width",
|
|
207
|
-
"border-style",
|
|
208
|
-
"border-color",
|
|
209
|
-
"margin",
|
|
210
|
-
"padding"
|
|
211
|
-
]);
|
|
212
|
-
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-)/;
|
|
213
|
-
function parseWebpackCssLayerNames(params) {
|
|
214
|
-
return params.split(",").map((name) => name.trim()).filter(Boolean);
|
|
215
|
-
}
|
|
216
|
-
function removeWebpackTailwindGeneratedAssetCss(source) {
|
|
217
|
-
const cleaned = removeTailwindV4GeneratedUserCssArtifacts(source);
|
|
218
|
-
try {
|
|
219
|
-
const root = postcss.parse(cleaned);
|
|
220
|
-
let changed = false;
|
|
221
|
-
let removingBannerPrefix = false;
|
|
222
|
-
for (const node of [...root.nodes]) {
|
|
223
|
-
if (node.type === "comment" && WEBPACK_TAILWIND_BANNER_RE.test(node.text)) {
|
|
224
|
-
node.remove();
|
|
225
|
-
changed = true;
|
|
226
|
-
removingBannerPrefix = true;
|
|
227
|
-
continue;
|
|
228
|
-
}
|
|
229
|
-
if (!removingBannerPrefix) continue;
|
|
230
|
-
if (isWebpackTailwindGeneratedPrefixNode(node)) {
|
|
231
|
-
node.remove();
|
|
232
|
-
changed = true;
|
|
233
|
-
continue;
|
|
234
|
-
}
|
|
235
|
-
removingBannerPrefix = false;
|
|
236
|
-
}
|
|
237
|
-
root.walkAtRules("layer", (rule) => {
|
|
238
|
-
const names = parseWebpackCssLayerNames(rule.params);
|
|
239
|
-
const hasGeneratedLayerName = names.some((name) => WEBPACK_TAILWIND_GENERATED_LAYER_NAMES.has(name));
|
|
240
|
-
const isLayerDeclaration = rule.nodes === void 0;
|
|
241
|
-
const shouldRemoveLayer = isLayerDeclaration ? hasGeneratedLayerName : names.length > 0 && names.every((name) => WEBPACK_TAILWIND_GENERATED_LAYER_NAMES.has(name));
|
|
242
|
-
if (shouldRemoveLayer && isLayerDeclaration) {
|
|
243
|
-
rule.remove();
|
|
244
|
-
changed = true;
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
if (shouldRemoveLayer && !names.includes("utilities")) {
|
|
248
|
-
for (const child of [...rule.nodes ?? []]) if (isWebpackTailwindGeneratedLayerNode(child, names)) {
|
|
249
|
-
child.remove();
|
|
250
|
-
changed = true;
|
|
251
|
-
}
|
|
252
|
-
if (rule.nodes?.length === 0) {
|
|
253
|
-
rule.remove();
|
|
254
|
-
changed = true;
|
|
255
|
-
}
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
if (shouldRemoveLayer) {
|
|
259
|
-
for (const child of [...rule.nodes ?? []]) if (isWebpackTailwindGeneratedLayerNode(child, names)) {
|
|
260
|
-
child.remove();
|
|
261
|
-
changed = true;
|
|
262
|
-
}
|
|
263
|
-
if (rule.nodes?.length === 0) {
|
|
264
|
-
rule.remove();
|
|
265
|
-
changed = true;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
root.walkRules((rule) => {
|
|
270
|
-
if (rule.parent?.type === "atrule" && rule.parent.name === "layer") return;
|
|
271
|
-
const selector = rule.selector.trim();
|
|
272
|
-
if (WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE.test(selector) || isWebpackTailwindGeneratedPreflightRule(rule)) {
|
|
273
|
-
rule.remove();
|
|
274
|
-
changed = true;
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
root.walkComments((comment) => {
|
|
278
|
-
if (WEBPACK_TAILWIND_BANNER_RE.test(comment.text)) {
|
|
279
|
-
comment.remove();
|
|
280
|
-
changed = true;
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
root.walkAtRules((rule) => {
|
|
284
|
-
if (rule.nodes !== void 0 && rule.nodes.length === 0) {
|
|
285
|
-
rule.remove();
|
|
286
|
-
changed = true;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
return changed ? root.toString() : cleaned;
|
|
290
|
-
} catch {
|
|
291
|
-
return cleaned;
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
function isWebpackTailwindGeneratedPrefixNode(node) {
|
|
295
|
-
if (node.type === "rule") return isWebpackTailwindGeneratedRule(node, [
|
|
296
|
-
"theme",
|
|
297
|
-
"base",
|
|
298
|
-
"utilities"
|
|
299
|
-
], true);
|
|
300
|
-
if (node.type !== "atrule") return false;
|
|
301
|
-
const names = node.name === "layer" ? parseWebpackCssLayerNames(node.params) : [];
|
|
302
|
-
if (node.name === "property" && node.params.trim().startsWith("--tw-")) return true;
|
|
303
|
-
if (names.length > 0 && names.every((name) => WEBPACK_TAILWIND_GENERATED_LAYER_NAMES.has(name))) {
|
|
304
|
-
if (node.nodes === void 0) return true;
|
|
305
|
-
return node.nodes.length > 0 && node.nodes.every((child) => isWebpackTailwindGeneratedLayerNode(child, names));
|
|
306
|
-
}
|
|
307
|
-
if (node.nodes === void 0 || node.nodes.length === 0) return false;
|
|
308
|
-
return node.nodes.every((child) => isWebpackTailwindGeneratedPrefixNode(child));
|
|
309
|
-
}
|
|
310
|
-
function isWebpackTailwindGeneratedLayerNode(node, layerNames) {
|
|
311
|
-
if (node.type === "rule") return isWebpackTailwindGeneratedRule(node, layerNames, false);
|
|
312
|
-
if (node.type !== "atrule") return false;
|
|
313
|
-
if (node.name === "property" && node.params.trim().startsWith("--tw-")) return true;
|
|
314
|
-
if (node.nodes === void 0 || node.nodes.length === 0) return false;
|
|
315
|
-
return node.nodes.every((child) => isWebpackTailwindGeneratedLayerNode(child, layerNames));
|
|
316
|
-
}
|
|
317
|
-
function isWebpackTailwindGeneratedRule(rule, layerNames, includePrefix) {
|
|
318
|
-
const selectors = rule.selectors ?? [rule.selector];
|
|
319
|
-
if (selectors.every((selector) => isWebpackTailwindGeneratedUtilitySelector(selector.trim(), includePrefix))) return true;
|
|
320
|
-
if (selectors.every((selector) => isWebpackTailwindGeneratedUtilitySelector(selector.trim(), true))) return true;
|
|
321
|
-
if (layerNames.includes("theme") && isWebpackTailwindGeneratedThemeRule(rule)) return true;
|
|
322
|
-
if (layerNames.includes("base") && isWebpackTailwindGeneratedPreflightRule(rule)) return true;
|
|
323
|
-
return false;
|
|
324
|
-
}
|
|
325
|
-
function isWebpackTailwindGeneratedThemeRule(rule) {
|
|
326
|
-
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
327
|
-
return declarations.length > 0 && declarations.every((decl) => WEBPACK_TAILWIND_THEME_TOKEN_RE.test(decl.prop) || decl.value.includes("--theme("));
|
|
328
|
-
}
|
|
329
|
-
function isWebpackTailwindGeneratedPreflightRule(rule) {
|
|
330
|
-
const selectors = rule.selectors ?? [rule.selector];
|
|
331
|
-
const declarations = (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
332
|
-
return selectors.length > 0 && declarations.length > 0 && selectors.every((selector) => {
|
|
333
|
-
const normalized = selector.trim().replace(/\s+/g, " ");
|
|
334
|
-
return WEBPACK_TAILWIND_PREFLIGHT_SELECTORS.has(normalized);
|
|
335
|
-
}) && declarations.every((decl) => WEBPACK_TAILWIND_PREFLIGHT_PROPS.has(decl.prop));
|
|
336
|
-
}
|
|
337
|
-
function isOnlyWebpackTailwindGeneratedPreflightCss(source) {
|
|
338
|
-
try {
|
|
339
|
-
const nodes = postcss.parse(source).nodes ?? [];
|
|
340
|
-
return nodes.length > 0 && nodes.every((node) => {
|
|
341
|
-
if (node.type === "rule") return isWebpackTailwindGeneratedPreflightRule(node);
|
|
342
|
-
return node.type === "atrule" && (node.nodes === void 0 || node.nodes.length === 0);
|
|
343
|
-
});
|
|
344
|
-
} catch {
|
|
345
|
-
return false;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
function isWebpackTailwindGeneratedUtilitySelector(selector, includePrefix) {
|
|
349
|
-
return WEBPACK_TAILWIND_UTILITY_RULE_MARKER_RE.test(selector) || includePrefix && WEBPACK_TAILWIND_UTILITY_PREFIX_RE.test(selector);
|
|
350
|
-
}
|
|
351
|
-
function collectWebpackCssRuleIdentityMarkers(source) {
|
|
352
|
-
const markers = /* @__PURE__ */ new Set();
|
|
353
|
-
try {
|
|
354
|
-
const root = postcss.parse(source);
|
|
355
|
-
root.walkRules((rule) => {
|
|
356
|
-
for (const selector of rule.selectors) for (const match of selector.matchAll(/\.((?:\\.|[_a-z\u00A0-\uFFFF-])(?:\\.|[\w\u00A0-\uFFFF-])*)/gi)) markers.add(`class:${match[1]}`);
|
|
357
|
-
});
|
|
358
|
-
root.walkAtRules("keyframes", (rule) => {
|
|
359
|
-
if (rule.params) markers.add(`keyframes:${rule.params}`);
|
|
360
|
-
});
|
|
361
|
-
} catch {}
|
|
362
|
-
return markers;
|
|
363
|
-
}
|
|
364
|
-
function unescapeCssIdentifier(value) {
|
|
365
|
-
return value.replace(/\\([0-9a-f]{1,6}\s?|.)/gi, (_match, escaped) => {
|
|
366
|
-
const hex = escaped.trim();
|
|
367
|
-
if (/^[0-9a-f]+$/i.test(hex)) return String.fromCodePoint(Number.parseInt(hex, 16));
|
|
368
|
-
return escaped;
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
163
|
function collectGeneratedCssRuntimeCandidates(source) {
|
|
372
|
-
const candidates =
|
|
373
|
-
|
|
374
|
-
try {
|
|
375
|
-
postcss.parse(source).walkRules((rule) => {
|
|
376
|
-
for (const selector of rule.selectors) for (const match of selector.matchAll(/\.((?:\\.|[\w\u00A0-\uFFFF-])(?:\\.|[\w\u00A0-\uFFFF-])*)/g)) {
|
|
377
|
-
const candidate = unescapeCssIdentifier(match[1]);
|
|
378
|
-
if (isRuntimeTransformCandidate(candidate)) candidates.add(candidate);
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
} catch {}
|
|
164
|
+
const candidates = collectGeneratedCssClassCandidates(source);
|
|
165
|
+
for (const candidate of candidates) if (!isRuntimeTransformCandidate(candidate)) candidates.delete(candidate);
|
|
382
166
|
return candidates;
|
|
383
167
|
}
|
|
384
|
-
function hasAdditionalWebpackAssetUserCssMarkers(rawSource, generatorRawSource) {
|
|
385
|
-
const rawMarkers = collectWebpackAssetUserCssMarkers(rawSource);
|
|
386
|
-
if (rawMarkers.size === 0) return false;
|
|
387
|
-
const generatorMarkers = collectWebpackAssetUserCssMarkers(generatorRawSource);
|
|
388
|
-
for (const marker of rawMarkers) if (!generatorMarkers.has(marker)) return true;
|
|
389
|
-
return false;
|
|
390
|
-
}
|
|
391
|
-
function hasWebpackTailwindSourceDirectives(source) {
|
|
392
|
-
return Boolean(source) && (hasTailwindRootDirectives(source, { importFallback: true }) || hasTailwindSourceDirectives(source, { importFallback: true }) || hasTailwindApplyDirective(source) || hasTailwindGeneratedCss(source) || hasTailwindGeneratedCssMarkers(source));
|
|
393
|
-
}
|
|
394
168
|
function resolveConfiguredWebpackCssPreflight(compilerOptions, styleOptions) {
|
|
395
169
|
return styleOptions.cssPreflight ?? compilerOptions.cssPreflight ?? getDefaultCssPreflight();
|
|
396
170
|
}
|
|
397
171
|
function resolveExistingWebpackCssPreflight(compilerOptions, styleOptions, source) {
|
|
398
172
|
return hasMiniProgramPreflightSelector(source) ? resolveConfiguredWebpackCssPreflight(compilerOptions, styleOptions) : void 0;
|
|
399
173
|
}
|
|
400
|
-
function removeMiniProgramPreflightSelectorRule(source) {
|
|
401
|
-
try {
|
|
402
|
-
const root = postcss.parse(source);
|
|
403
|
-
let changed = false;
|
|
404
|
-
root.walkRules((rule) => {
|
|
405
|
-
const selectors = new Set((rule.selectors ?? [rule.selector]).map((selector) => selector.trim().replace(/^:before$/, "::before").replace(/^:after$/, "::after")));
|
|
406
|
-
if (selectors.has("view") && selectors.has("text") && selectors.has("::before") && selectors.has("::after")) {
|
|
407
|
-
rule.remove();
|
|
408
|
-
changed = true;
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
return changed ? root.toString() : source;
|
|
412
|
-
} catch {
|
|
413
|
-
return source.replace(/(?:^|[}\s])\s*view\s*,\s*text\s*,\s*::after\s*,\s*::before\s*\{[^}]*\}/g, "");
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
function dedupeMiniProgramPreflightSelectorRules(source) {
|
|
417
|
-
try {
|
|
418
|
-
const root = postcss.parse(source);
|
|
419
|
-
let firstRule;
|
|
420
|
-
let changed = false;
|
|
421
|
-
root.walkRules((rule) => {
|
|
422
|
-
const selectors = new Set((rule.selectors ?? [rule.selector]).map((selector) => selector.trim().replace(/^:before$/, "::before").replace(/^:after$/, "::after")));
|
|
423
|
-
if (!selectors.has("view") || !selectors.has("text") || !selectors.has("::before") || !selectors.has("::after")) return;
|
|
424
|
-
if (!firstRule) {
|
|
425
|
-
firstRule = rule;
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
const existingProps = /* @__PURE__ */ new Set();
|
|
429
|
-
firstRule.walkDecls((decl) => {
|
|
430
|
-
existingProps.add(decl.prop);
|
|
431
|
-
});
|
|
432
|
-
rule.walkDecls((decl) => {
|
|
433
|
-
if (!existingProps.has(decl.prop)) {
|
|
434
|
-
firstRule?.append(decl.clone());
|
|
435
|
-
existingProps.add(decl.prop);
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
rule.remove();
|
|
439
|
-
changed = true;
|
|
440
|
-
});
|
|
441
|
-
return changed ? root.toString() : source;
|
|
442
|
-
} catch {
|
|
443
|
-
return source;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
function hasMiniProgramPreflightSelector(source) {
|
|
447
|
-
try {
|
|
448
|
-
let found = false;
|
|
449
|
-
postcss.parse(source).walkRules((rule) => {
|
|
450
|
-
const selectors = new Set((rule.selectors ?? [rule.selector]).map((selector) => selector.trim().replace(/^:before$/, "::before").replace(/^:after$/, "::after")));
|
|
451
|
-
if (selectors.has("view") && selectors.has("text") && selectors.has("::before") && selectors.has("::after")) {
|
|
452
|
-
found = true;
|
|
453
|
-
return false;
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
return found;
|
|
457
|
-
} catch {
|
|
458
|
-
return /(?:^|[},])\s*view\s*,\s*text\s*,\s*::after\s*,\s*::before\s*\{/.test(source);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
function ensureWebpackMiniProgramTwContentInit(source) {
|
|
462
|
-
if (!source.includes("var(--tw-content)")) return source;
|
|
463
|
-
try {
|
|
464
|
-
const root = postcss.parse(source);
|
|
465
|
-
let changed = false;
|
|
466
|
-
root.walkRules((rule) => {
|
|
467
|
-
const selectors = new Set((rule.selectors ?? [rule.selector]).map((selector) => selector.trim().replace(/^:before$/, "::before").replace(/^:after$/, "::after")));
|
|
468
|
-
if (!selectors.has("view") || !selectors.has("text") || !selectors.has("::before") || !selectors.has("::after")) return;
|
|
469
|
-
let hasContentInit = false;
|
|
470
|
-
rule.walkDecls("--tw-content", () => {
|
|
471
|
-
hasContentInit = true;
|
|
472
|
-
});
|
|
473
|
-
if (!hasContentInit) {
|
|
474
|
-
rule.append(postcss.decl({
|
|
475
|
-
prop: "--tw-content",
|
|
476
|
-
value: "''"
|
|
477
|
-
}));
|
|
478
|
-
changed = true;
|
|
479
|
-
}
|
|
480
|
-
return false;
|
|
481
|
-
});
|
|
482
|
-
return changed ? root.toString() : source;
|
|
483
|
-
} catch {
|
|
484
|
-
return source;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
function removeTailwindV4StandaloneHostPreflightRule(source) {
|
|
488
|
-
if (!source.includes("--theme(")) return source;
|
|
489
|
-
try {
|
|
490
|
-
const root = postcss.parse(source);
|
|
491
|
-
let changed = false;
|
|
492
|
-
root.walkRules((rule) => {
|
|
493
|
-
if (rule.selector.trim() !== ":host") return;
|
|
494
|
-
if (!rule.nodes?.some((node) => node.type === "decl" && node.value?.includes("--theme("))) return;
|
|
495
|
-
rule.remove();
|
|
496
|
-
changed = true;
|
|
497
|
-
});
|
|
498
|
-
return changed ? root.toString() : source;
|
|
499
|
-
} catch {
|
|
500
|
-
return source;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
174
|
function collectRuntimeTokenSignatureParts(source) {
|
|
504
175
|
return source.match(/[\w-]+_[A-Z][\w-]*/gi) ?? [];
|
|
505
176
|
}
|
|
@@ -536,9 +207,6 @@ function pruneMapToMaxSize(map, maxSize) {
|
|
|
536
207
|
map.delete(oldestKey);
|
|
537
208
|
}
|
|
538
209
|
}
|
|
539
|
-
function stripTrailingLineWhitespace(source) {
|
|
540
|
-
return source.replace(/[ \t]+$/gm, "");
|
|
541
|
-
}
|
|
542
210
|
function pruneWebpackCssHandlerOptionCaches(cssHandlerOptionsCache, cssUserHandlerOptionsCache, activeCssFiles) {
|
|
543
211
|
const activeSuffixes = [...activeCssFiles].map((file) => `:${file}`);
|
|
544
212
|
for (const key of cssHandlerOptionsCache.keys()) if (!activeSuffixes.some((suffix) => key.endsWith(suffix))) cssHandlerOptionsCache.delete(key);
|
|
@@ -610,14 +278,15 @@ function includesTailwindPreflightImport(source) {
|
|
|
610
278
|
function finalizeMiniProgramUserCssAssetSource(source, compilerOptions, isWebGeneratorTarget, options = {}) {
|
|
611
279
|
const styleOptions = resolveStyleOptionsFromContext(compilerOptions);
|
|
612
280
|
if (isWebGeneratorTarget) return source;
|
|
613
|
-
const
|
|
281
|
+
const finalized = finalizeMiniProgramCss$1(removeMiniProgramInteractiveSelectors(source, {
|
|
614
282
|
active: styleOptions.cssRemoveActivePseudoClass ?? true,
|
|
615
283
|
hover: styleOptions.cssRemoveHoverPseudoClass ?? true
|
|
616
284
|
}), {
|
|
617
285
|
cssPreflight: options.cssPreflight === false ? false : !hasMiniProgramTailwindV4PreflightReset(source) ? resolveConfiguredWebpackCssPreflight(compilerOptions, styleOptions) : void 0,
|
|
618
286
|
isTailwindcssV4: true,
|
|
619
287
|
tailwindcssV4GradientFallback: styleOptions.tailwindcssV4GradientFallback
|
|
620
|
-
})
|
|
288
|
+
});
|
|
289
|
+
const output = removeTailwindV4StandaloneHostPreflightRule(finalized);
|
|
621
290
|
return stripMiniProgramCssSpecificityPlaceholders(output);
|
|
622
291
|
}
|
|
623
292
|
function shouldFallbackToWebpackUserCssOnGeneratorError(options) {
|
|
@@ -656,7 +325,7 @@ function finalizeWebpackCssAssetSource(source, compilerOptions, isWebGeneratorTa
|
|
|
656
325
|
} catch {}
|
|
657
326
|
const shouldRemoveExistingPreflight = options.cssPreflight === false && options.preserveExistingPreflight === false;
|
|
658
327
|
if (shouldRemoveExistingPreflight) finalized = removeMiniProgramPreflightSelectorRule(finalized);
|
|
659
|
-
const hasExistingMiniProgramPreflight = options.preserveExistingPreflight !== false && hasMiniProgramPreflightSelector(source);
|
|
328
|
+
const hasExistingMiniProgramPreflight = options.preserveExistingPreflight !== false && hasMiniProgramPreflightSelector$1(source);
|
|
660
329
|
finalized = finalizeMiniProgramCss$1(finalized, {
|
|
661
330
|
cssPreflight: options.cssPreflight === false && !hasExistingMiniProgramPreflight ? false : !hasMiniProgramTailwindV4PreflightReset(finalized) ? resolveExistingWebpackCssPreflight(compilerOptions, styleOptions, source) : void 0,
|
|
662
331
|
isTailwindcssV4: true,
|
|
@@ -847,73 +516,8 @@ function shouldUseWebpackAssetAsGeneratorUserCss(rawSource, generatorRawSource,
|
|
|
847
516
|
const rawMarkers = collectWebpackAssetUserCssMarkers(rawSource);
|
|
848
517
|
return rawSource !== generatorRawSource && (options.processed === true || !rawSource.includes("data:")) && !hasTailwindRootDirectives(rawSource, { importFallback: true }) && !hasTailwindSourceDirectives(rawSource, { importFallback: true }) && !hasTailwindApplyDirective(rawSource) && rawMarkers.size > 0 && !isOnlyWebpackTailwindGeneratedPreflightCss(rawSource) && (!hasTailwindGeneratedCssMarkers(rawSource) || hasAdditionalWebpackAssetUserCssMarkers(rawSource, generatorRawSource));
|
|
849
518
|
}
|
|
850
|
-
function hasWebpackClassSelector(selector) {
|
|
851
|
-
return /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i.test(selector);
|
|
852
|
-
}
|
|
853
|
-
function isWebpackKeyframesRule(rule) {
|
|
854
|
-
let parent = rule.parent;
|
|
855
|
-
while (parent) {
|
|
856
|
-
if (parent.type === "atrule" && parent.name.endsWith("keyframes")) return true;
|
|
857
|
-
parent = parent.parent;
|
|
858
|
-
}
|
|
859
|
-
return false;
|
|
860
|
-
}
|
|
861
|
-
function collectWebpackBareSelectorUserCss(source) {
|
|
862
|
-
try {
|
|
863
|
-
const normalizedSource = removeTailwindSourceDirectives(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(source)), { importFallback: true });
|
|
864
|
-
const root = postcss.parse(normalizedSource);
|
|
865
|
-
let changed = false;
|
|
866
|
-
root.walkAtRules((rule) => {
|
|
867
|
-
if (rule.name === "import" || rule.name === "font-face" || rule.name.endsWith("keyframes")) {
|
|
868
|
-
rule.remove();
|
|
869
|
-
changed = true;
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
root.walkRules((rule) => {
|
|
873
|
-
if (isWebpackKeyframesRule(rule) || rule.selectors.some((selector) => hasWebpackClassSelector(selector))) {
|
|
874
|
-
rule.remove();
|
|
875
|
-
changed = true;
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
root.walkAtRules((rule) => {
|
|
879
|
-
if (rule.nodes !== void 0 && rule.nodes.length === 0) {
|
|
880
|
-
rule.remove();
|
|
881
|
-
changed = true;
|
|
882
|
-
}
|
|
883
|
-
});
|
|
884
|
-
return changed ? root.toString() : normalizedSource;
|
|
885
|
-
} catch {
|
|
886
|
-
return "";
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
519
|
//#endregion
|
|
890
520
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.ts
|
|
891
|
-
function isWebpackTailwindImportRequest(request) {
|
|
892
|
-
return request === "tailwindcss" || request === "tailwindcss4" || request?.startsWith("tailwindcss/") || request?.startsWith("tailwindcss4/") || request === "weapp-tailwindcss" || request?.startsWith("weapp-tailwindcss/");
|
|
893
|
-
}
|
|
894
|
-
function removeWebpackGeneratorNonTailwindImports(source) {
|
|
895
|
-
if (!source?.includes("@import")) return source;
|
|
896
|
-
try {
|
|
897
|
-
const root = postcss.parse(source);
|
|
898
|
-
let changed = false;
|
|
899
|
-
root.walkAtRules("import", (rule) => {
|
|
900
|
-
if (isWebpackTailwindImportRequest(parseImportRequest(rule.params))) return;
|
|
901
|
-
rule.remove();
|
|
902
|
-
changed = true;
|
|
903
|
-
});
|
|
904
|
-
return changed ? root.toString() : source;
|
|
905
|
-
} catch {
|
|
906
|
-
return source;
|
|
907
|
-
}
|
|
908
|
-
}
|
|
909
|
-
function isWebpackCssSourceRepresentedInAsset(rawSource, sourceCss) {
|
|
910
|
-
if (!sourceCss || !hasWebpackTailwindSourceDirectives(sourceCss)) return false;
|
|
911
|
-
const sourceMarkers = collectWebpackCssRuleIdentityMarkers(sourceCss);
|
|
912
|
-
if (sourceMarkers.size === 0) return false;
|
|
913
|
-
const rawMarkers = collectWebpackCssRuleIdentityMarkers(rawSource);
|
|
914
|
-
for (const marker of sourceMarkers) if (!rawMarkers.has(marker)) return false;
|
|
915
|
-
return true;
|
|
916
|
-
}
|
|
917
521
|
function createWebpackGeneratorCssSource(file, css) {
|
|
918
522
|
if (!file || !css || !hasWebpackTailwindSourceDirectives(css)) return;
|
|
919
523
|
return {
|
|
@@ -948,24 +552,6 @@ function createWebpackUserCssSourceAppend(sources, generatorRawSource, currentSo
|
|
|
948
552
|
processed: matchedSources.every((source) => source.processed)
|
|
949
553
|
} : void 0;
|
|
950
554
|
}
|
|
951
|
-
function createWebpackGeneratorUserCssSourceAppend(...sources) {
|
|
952
|
-
const parts = sources.filter((source) => source !== void 0 && source.css.trim().length > 0);
|
|
953
|
-
if (parts.length === 0) return;
|
|
954
|
-
let css = "";
|
|
955
|
-
const usedParts = [];
|
|
956
|
-
for (const source of parts) {
|
|
957
|
-
const merged = css.trim().length > 0 ? mergeCoveredCssRuleDeclarations(css, source.css) : void 0;
|
|
958
|
-
if (merged?.changed) css = merged.baseCss;
|
|
959
|
-
const nextCss = css.trim().length > 0 ? filterExistingCssRules(css, merged?.css ?? source.css) : source.css;
|
|
960
|
-
if (!(nextCss.trim().length > 0)) continue;
|
|
961
|
-
css = createCssSourceOrderAppend(css, nextCss);
|
|
962
|
-
usedParts.push(source);
|
|
963
|
-
}
|
|
964
|
-
return {
|
|
965
|
-
css,
|
|
966
|
-
processed: usedParts.every((source) => source.processed)
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
555
|
//#endregion
|
|
970
556
|
//#region src/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.ts
|
|
971
557
|
function normalizeWebpackCssSourceRef(file) {
|
|
@@ -1460,18 +1046,19 @@ async function processWebpackGeneratedCssAsset(element, context) {
|
|
|
1460
1046
|
const shouldPreserveGeneratedWebAssetUserCss = isWebGeneratorTarget && currentAssetLooksGenerated && !currentAssetHasBundlerGeneratedMarker && !currentAssetHasAdditionalUserCss;
|
|
1461
1047
|
const hasExplicitSourceCssForCurrentAsset = sourceCss !== void 0 && (hasTailwindRootDirectives(sourceCss, { importFallback: true }) || hasTailwindSourceDirectives(sourceCss, { importFallback: true }) || hasTailwindApplyDirective(sourceCss));
|
|
1462
1048
|
const currentAssetHasUserCss = (sourceCssProcessed || hasExplicitSourceCssForCurrentAsset) && currentAssetLooksGenerated && !shouldPreserveGeneratedWebAssetUserCss ? currentAssetHasAdditionalUserCss : shouldUseWebpackAssetAsGeneratorUserCss(currentAssetUserCssSource, generatorRawSource, { processed: sourceCssProcessed || shouldPreserveGeneratedWebAssetUserCss });
|
|
1049
|
+
const shouldAppendCurrentAssetUserCss = shouldAppendCurrentWebpackAssetUserCss({
|
|
1050
|
+
currentAssetHasBundlerGeneratedMarker,
|
|
1051
|
+
currentAssetHasUserCss,
|
|
1052
|
+
currentAssetLooksGenerated,
|
|
1053
|
+
registeredUserRawSource,
|
|
1054
|
+
shouldPreserveGeneratedWebAssetUserCss,
|
|
1055
|
+
sourceCssProcessed
|
|
1056
|
+
});
|
|
1463
1057
|
const userRawSource = createWebpackGeneratorUserCssSourceAppend(createWebpackCurrentAssetUserRawSource({
|
|
1464
1058
|
currentAssetHasUserCss,
|
|
1465
1059
|
currentAssetLooksGenerated,
|
|
1466
1060
|
currentAssetUserCssSource,
|
|
1467
|
-
shouldAppendCurrentAssetUserCss
|
|
1468
|
-
currentAssetHasBundlerGeneratedMarker,
|
|
1469
|
-
currentAssetHasUserCss,
|
|
1470
|
-
currentAssetLooksGenerated,
|
|
1471
|
-
registeredUserRawSource,
|
|
1472
|
-
shouldPreserveGeneratedWebAssetUserCss,
|
|
1473
|
-
sourceCssProcessed
|
|
1474
|
-
}),
|
|
1061
|
+
shouldAppendCurrentAssetUserCss,
|
|
1475
1062
|
sourceCssProcessed
|
|
1476
1063
|
}), registeredUserRawSource);
|
|
1477
1064
|
if (isPureLocalCssImportWrapper(currentRawSource)) return { result: new ConcatSource(removeTailwindSourceDirectives(stripBundlerGeneratedCssMarkers(currentRawSource), { importFallback: true })) };
|
|
@@ -2013,7 +1600,7 @@ function compactSnapshot(snapshot) {
|
|
|
2013
1600
|
};
|
|
2014
1601
|
}
|
|
2015
1602
|
function normalizeChangedFiles(changedFiles) {
|
|
2016
|
-
return new Set([...changedFiles ?? []].map((file) => resolveSourceScanPath(file)));
|
|
1603
|
+
return new Set([...changedFiles ?? []].map((file) => (0, source_scan_exports.resolveSourceScanPath)(file)));
|
|
2017
1604
|
}
|
|
2018
1605
|
async function resolveScanFileSnapshot(file) {
|
|
2019
1606
|
try {
|
|
@@ -2045,7 +1632,7 @@ async function resolveScanFiles(roots, outDir) {
|
|
|
2045
1632
|
outDir,
|
|
2046
1633
|
root: root.root
|
|
2047
1634
|
});
|
|
2048
|
-
for (const file of rootFiles) files.add(resolveSourceScanPath(file));
|
|
1635
|
+
for (const file of rootFiles) files.add((0, source_scan_exports.resolveSourceScanPath)(file));
|
|
2049
1636
|
}));
|
|
2050
1637
|
return files;
|
|
2051
1638
|
}
|
|
@@ -2498,7 +2085,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2498
2085
|
});
|
|
2499
2086
|
}
|
|
2500
2087
|
//#endregion
|
|
2501
|
-
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.21.2_tsx@4.23.
|
|
2088
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.0_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.21.2_tsx@4.23._475cb3276c2c08d961b53664cc0a7309/node_modules/tsdown/esm-shims.js
|
|
2502
2089
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
2503
2090
|
const getDirname = () => path.dirname(getFilename());
|
|
2504
2091
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -3264,7 +2851,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
3264
2851
|
const file = path.resolve(source.file);
|
|
3265
2852
|
const previous = webpackCssSources.get(file);
|
|
3266
2853
|
const next = {
|
|
3267
|
-
css: typeof source.css === "string" ? normalizeTailwindConfigDirectives(source.css, path.dirname(file)) : source.css,
|
|
2854
|
+
css: typeof source.css === "string" ? normalizeTailwindConfigDirectives$1(source.css, path.dirname(file)) : source.css,
|
|
3268
2855
|
processed: source.processed
|
|
3269
2856
|
};
|
|
3270
2857
|
if (previous && shouldKeepPreviousWebpackCssSource(previous, next)) {
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_webpack = require("./webpack-
|
|
2
|
+
const require_webpack = require("./webpack-BetjemzT.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_webpack.WeappTailwindcss;
|
|
5
5
|
exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
|
package/dist/webpack.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, t as WeappTailwindcss } from "./webpack-Bhkd27Rs.js";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.5.
|
|
4
|
+
"version": "5.5.8",
|
|
5
5
|
"description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -190,12 +190,16 @@
|
|
|
190
190
|
},
|
|
191
191
|
"peerDependencies": {
|
|
192
192
|
"@mpxjs/webpack-plugin": ">=2.0.0 <3.0.0",
|
|
193
|
+
"tailwindcss": "^4.0.0",
|
|
193
194
|
"vite": "^5.2.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
194
195
|
},
|
|
195
196
|
"peerDependenciesMeta": {
|
|
196
197
|
"@mpxjs/webpack-plugin": {
|
|
197
198
|
"optional": true
|
|
198
199
|
},
|
|
200
|
+
"tailwindcss": {
|
|
201
|
+
"optional": true
|
|
202
|
+
},
|
|
199
203
|
"vite": {
|
|
200
204
|
"optional": true
|
|
201
205
|
}
|
|
@@ -204,26 +208,27 @@
|
|
|
204
208
|
"@babel/parser": "^8.0.5",
|
|
205
209
|
"@babel/traverse": "^8.0.5",
|
|
206
210
|
"@babel/types": "^8.0.5",
|
|
207
|
-
"@tailwindcss-mangle/engine": "0.2.0",
|
|
208
211
|
"@vue/compiler-dom": "^3.5.41",
|
|
209
212
|
"@weapp-core/escape": "~8.0.0",
|
|
213
|
+
"@weapp-tailwindcss/engine": "0.1.1",
|
|
210
214
|
"@weapp-tailwindcss/logger": "2.0.3",
|
|
211
|
-
"@weapp-tailwindcss/postcss": "3.3.
|
|
215
|
+
"@weapp-tailwindcss/postcss": "3.3.7",
|
|
212
216
|
"@weapp-tailwindcss/reset": "0.1.4",
|
|
213
217
|
"@weapp-tailwindcss/shared": "2.0.3",
|
|
218
|
+
"@weapp-tailwindcss/source-scan": "0.1.1",
|
|
214
219
|
"comment-json": "^5.0.0",
|
|
215
220
|
"debug": "~4.4.3",
|
|
216
221
|
"fast-glob": "^3.3.3",
|
|
217
222
|
"htmlparser2": "^12.0.0",
|
|
218
223
|
"local-pkg": "^1.2.1",
|
|
219
|
-
"lru-cache": "11.5.
|
|
224
|
+
"lru-cache": "11.5.3",
|
|
220
225
|
"magic-string": "^1.4.1",
|
|
221
226
|
"micromatch": "^4.0.8",
|
|
222
|
-
"oxc-parser": "^0.
|
|
227
|
+
"oxc-parser": "^0.151.0",
|
|
223
228
|
"oxc-walker": "^1.1.1",
|
|
224
229
|
"semver": "~7.8.5",
|
|
225
|
-
"tailwindcss-config": "2.0.
|
|
226
|
-
"weapp-style-injector": "1.0.
|
|
230
|
+
"tailwindcss-config": "2.0.5",
|
|
231
|
+
"weapp-style-injector": "1.0.6",
|
|
227
232
|
"yaml": "^2.9.1"
|
|
228
233
|
},
|
|
229
234
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("@weapp-tailwindcss/postcss");
|