weapp-tailwindcss 5.4.2 → 5.5.1
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.md +13 -1
- package/README.zh-CN.md +13 -1
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -0
- package/dist/bundlers/vite/capability-profile.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer/web-plugin.d.ts +3 -0
- package/dist/bundlers/vite/css-handler-options.d.ts +32 -0
- package/dist/bundlers/vite/{generate-bundle/css-output.d.ts → css-output.d.ts} +1 -1
- package/dist/bundlers/vite/frameworks/generic/web.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +2 -32
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/runtime.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle.d.ts +1 -1
- package/dist/bundlers/vite/runtime-class-set.d.ts +1 -5
- package/dist/bundlers/vite/shared/create-css-only-plugins-runtime.d.ts +3 -0
- package/dist/cache-CBJFB1HN.cjs +223 -0
- package/dist/compiler/events.d.ts +32 -0
- package/dist/compiler/host.d.ts +13 -0
- package/dist/compiler/index.d.ts +3 -0
- package/dist/compiler/runtime-state.d.ts +17 -0
- package/dist/compiler-B0YSc0DY.js +4877 -0
- package/dist/{wxml-o-CUulAM.cjs → compiler-D2ZJc3uA.cjs} +3649 -283
- package/dist/core.cjs +6 -3
- package/dist/core.d.ts +2 -0
- package/dist/core.js +4 -4
- package/dist/defaults-B5ep0ojb.js +120 -0
- package/dist/defaults-BI9j1znS.cjs +156 -0
- package/dist/defaults.cjs +5 -121
- package/dist/defaults.js +1 -116
- package/dist/final-css-cleanup-B0HUBtiE.js +308 -0
- package/dist/final-css-cleanup-DSjczga3.cjs +138 -0
- package/dist/{generator-WlhrtNa3.cjs → generator-DsrQ9txU.cjs} +62 -5
- package/dist/{generator-BjK5PRR-.js → generator-DyXTBPmE.js} +47 -2
- package/dist/generator.cjs +1 -1
- package/dist/generator.js +1 -1
- package/dist/{gulp-ChecVI6A.cjs → gulp-C9ENAx3f.cjs} +30 -28
- package/dist/{gulp-D6LcfRz_.js → gulp-DXeQfvVC.js} +7 -7
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-afnWvy7u.cjs → hmr-timing-Cz4IesEM.cjs} +6 -229
- package/dist/{hmr-timing-CqDfjvqE.js → hmr-timing-DNxQm-bN.js} +6 -1258
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/{pipeline-helpers-DxPFMGxz.cjs → pipeline-helpers-CSGnR5gh.cjs} +6 -5
- package/dist/postcss.cjs +1 -1
- package/dist/postcss.js +1 -1
- package/dist/presets.cjs +4 -4
- package/dist/presets.js +2 -2
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +2 -2
- package/dist/runtime-state-BBQcA0n5.cjs +54 -0
- package/dist/{source-candidate-scan-signature-FywFU3Rg.cjs → scoped-generator-TVjEaOeP.cjs} +5 -123
- package/dist/{source-candidate-scan-signature-BVScymyM.js → scoped-generator-kRj_5Axx.js} +4 -92
- package/dist/source-candidate-scan-signature-B7cUxqqX.cjs +129 -0
- package/dist/source-candidate-scan-signature-CsP4BQNa.js +92 -0
- package/dist/style-injector/internal.d.ts +1 -1
- package/dist/style-injector/vite-web.d.ts +3 -0
- package/dist/{tailwindcss-9xmoCkaR.js → tailwindcss-BK9S7zuq.js} +1 -2
- package/dist/{tailwindcss-D3jltF7M.cjs → tailwindcss-C-jBBQfw.cjs} +8 -9
- package/dist/{transform-DQhgAarN.js → transform-CfOzh007.js} +3 -3
- package/dist/{transform-C6k9zTQR.cjs → transform-DUPOPZ54.cjs} +27 -27
- package/dist/uni-app-x/vite/style-source.d.ts +11 -0
- package/dist/{v4-generation-core-CPKNwzjz.cjs → v4-generation-core-CRNUU_Rr.cjs} +29 -1172
- package/dist/vite/web.cjs +27 -0
- package/dist/vite/web.d.ts +1 -0
- package/dist/vite/web.js +25 -0
- package/dist/{vite-D3aCtpmv.js → vite-BXe-axax.js} +263 -3587
- package/dist/{vite-D-gmOkPN.cjs → vite-D_mAIfTU.cjs} +514 -3798
- package/dist/vite-web.d.ts +4 -0
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +5 -5
- package/dist/web-B2Ea9K4B.cjs +4361 -0
- package/dist/web-Cv7ualrU.js +3796 -0
- package/dist/{webpack-B-6a8Z8F.js → webpack-7Um2GFtx.js} +13 -12
- package/dist/{webpack-yAne9ZYu.cjs → webpack-Ce04-btG.cjs} +51 -49
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +13 -4
- package/dist/cache-options-DavPxrhC.cjs +0 -16
- package/dist/cache-options-DwBtLwQe.js +0 -5
- package/dist/compiler-B-m9VGqj.cjs +0 -2316
- package/dist/compiler-BgMj2E5l.js +0 -2051
- package/dist/local-style-matcher-DRpFEu1s.cjs +0 -34
- package/dist/local-style-matcher-DsiI2wIc.js +0 -17
- package/dist/object-B-8IHefx.js +0 -47
- package/dist/object-DbHtAXRk.cjs +0 -58
- package/dist/wxml-CvKyV69S.js +0 -1822
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-9xmoCkaR.js";
|
|
1
|
+
import { $ as hasTailwindRootDirectives, F as stripTailwindSourceMediaFragments, H as removeTailwindV4GeneratedUserCssArtifacts, I as stripUnmatchedTailwindSourceMediaCloseFragments, It as getTailwindV4IncrementalGenerateCacheStats, L as finalizeMiniProgramCss$1, M as isCommentOnlyCss, Mt as _defineProperty, N as removeMiniProgramInteractiveSelectors, O as resolveTailwindcssOptions, P as removeTailwindV4GeneratorAtRules, V as stripMiniProgramCssSpecificityPlaceholders, Z as hasTailwindApplyDirective, _ as upsertTailwindV4CssSource, at as removeTailwindSourceDirectives, dt as hasTailwindGeneratedCssMarkers, et as hasTailwindSourceDirectives, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, it as parseImportRequest, kt as resolveSourceScanPath, o as resolveRuntimeBranch, tt as normalizeTailwindConfigDirectives, ut as hasTailwindGeneratedCss, z as pruneMiniProgramGeneratedCss } from "./generator-DyXTBPmE.js";
|
|
2
|
+
import { f as resolveSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature } from "./tailwindcss-BK9S7zuq.js";
|
|
4
3
|
import { r as getGroupedEntries } from "./utils-MVwpU07P.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { A as createCssSourceTraceCacheSignature, C as isSourceStyleRequest, E as hasBundlerGeneratedCssMarker, F as createEscapeFragments, G as resolveSourceCandidateScanFiles, H as isSourceCandidateRequest, I as isPureLocalCssImportWrapper, M as isCssSourceTraceEnabled, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, P as collectStrictEscapedRuntimeCandidates, V as createSourceCandidateStore, _ as captureResolvedFrameworkPostcssOptions, c as collectRawSourceClassSelectors, h as removeGeneratedSelectorCompatCss, j as createCssTokenSourceMap, k as annotateCssSourceTrace, l as pushConcurrentTaskFactories, m as scoreTailwindV4CssSourceFileMatch, n as emitHmrTiming, r as generateTailwindV4Css, u as resolveTaskConcurrency, v as collectFrameworkPostcssOptionsFromLoaderEntries, w as stripRequestQuery, x as hasMiniProgramTailwindV4PreflightReset, y as createCssSourceOrderAppend, z as finalizeCompilerShadowRun } from "./hmr-timing-DNxQm-bN.js";
|
|
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-B0YSc0DY.js";
|
|
6
|
+
import { n as getDefaultCssPreflight } from "./defaults-B5ep0ojb.js";
|
|
7
|
+
import { a as createRuntimeCompilationAffectingSignature, c as resetRuntimeCompilationBuildState, i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-B0HUBtiE.js";
|
|
8
|
+
import { _ as resolveWebpackFrameworkProfile, d as resolvePluginDisabledState, h as webpackStyleInjectorDelegates, i as createCandidateSignature, n as createScopedGeneratorRuntime, p as createBuiltinWebpackStyleInjectorPlugin, u as classifyRuntimeEntry } from "./scoped-generator-kRj_5Axx.js";
|
|
9
|
+
import { a as toAbsoluteOutputPath, i as resolveOutputSpecifier, n as resolvePackageDir, t as createSourceCandidateScanSignature } from "./source-candidate-scan-signature-CsP4BQNa.js";
|
|
10
10
|
import Module, { createRequire } from "node:module";
|
|
11
11
|
import fs from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
@@ -2497,7 +2497,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
2497
2497
|
});
|
|
2498
2498
|
}
|
|
2499
2499
|
//#endregion
|
|
2500
|
-
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.21.2_tsx@4.
|
|
2500
|
+
//#region ../../node_modules/.pnpm/tsdown@0.22.14_@volar+typescript@2.4.28_typescript@6.0.3__oxc-resolver@11.21.2_tsx@4.23_b02e491bc323fb57b2dbb6592ff2d492/node_modules/tsdown/esm-shims.js
|
|
2501
2501
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
2502
2502
|
const getDirname = () => path.dirname(getFilename());
|
|
2503
2503
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
@@ -3147,11 +3147,12 @@ var WebpackFrameworkPlugin = class {
|
|
|
3147
3147
|
if (disabledOptions.plugin) return;
|
|
3148
3148
|
if (initialTailwindRuntime.majorVersion !== 4) throw new Error("weapp-tailwindcss/webpack 新生成管线仅支持 Tailwind CSS v4,请升级 tailwindcss 或停留在旧版 weapp-tailwindcss。");
|
|
3149
3149
|
setupWebpackWatchOutputIgnore(compiler);
|
|
3150
|
-
const
|
|
3150
|
+
const readyPromise = createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
3151
|
+
const runtimeState = createCompilerRuntimeState({
|
|
3151
3152
|
tailwindRuntime: initialTailwindRuntime,
|
|
3152
|
-
readyPromise
|
|
3153
|
+
readyPromise,
|
|
3153
3154
|
refreshTailwindcssRuntime: refreshTailwindRuntime
|
|
3154
|
-
};
|
|
3155
|
+
});
|
|
3155
3156
|
let runtimeSetPrepared = false;
|
|
3156
3157
|
let runtimeSetSignature;
|
|
3157
3158
|
let runtimeRefreshRequiredForCompilation = false;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
|
-
const require_generator = require("./generator-
|
|
3
|
-
const
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-D3jltF7M.cjs");
|
|
2
|
+
const require_generator = require("./generator-DsrQ9txU.cjs");
|
|
3
|
+
const require_tailwindcss = require("./tailwindcss-C-jBBQfw.cjs");
|
|
5
4
|
const require_utils = require("./utils-CuKLf1Zv.cjs");
|
|
6
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
5
|
+
const require_v4_generation_core = require("./v4-generation-core-CRNUU_Rr.cjs");
|
|
6
|
+
const require_compiler = require("./compiler-D2ZJc3uA.cjs");
|
|
7
|
+
const require_runtime_state = require("./runtime-state-BBQcA0n5.cjs");
|
|
8
|
+
const require_cache = require("./cache-CBJFB1HN.cjs");
|
|
9
|
+
const require_hmr_timing = require("./hmr-timing-Cz4IesEM.cjs");
|
|
10
|
+
const require_scoped_generator = require("./scoped-generator-TVjEaOeP.cjs");
|
|
11
|
+
const require_source_candidate_scan_signature = require("./source-candidate-scan-signature-B7cUxqqX.cjs");
|
|
12
|
+
const require_pipeline_helpers = require("./pipeline-helpers-CSGnR5gh.cjs");
|
|
12
13
|
const require_css_loader_runtime = require("./css-loader-runtime-CSv0lKqV.cjs");
|
|
13
14
|
const require_runtime_registry = require("./runtime-registry-BlIjpImP.cjs");
|
|
14
15
|
let node_fs = require("node:fs");
|
|
@@ -597,7 +598,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
|
|
|
597
598
|
})();
|
|
598
599
|
const runtimeAwareHash = createRuntimeAwareCssHash(cssChunkHash, compilerOptions.cache.computeHash(currentRawSource), `${createRuntimeSetHash(getGeneratorRuntimeSet())}:${runtimeAffectingSourceHash}:${webpackSourceCandidates?.signatureHash ?? "source-candidates:0"}:${webpackSourceCandidateValueSignature}:${cssSourceTraceSignature}:${cssSourceHash}:compiler-dependencies:${compilationDependencyRevision}`);
|
|
599
600
|
await enqueueTask(async () => {
|
|
600
|
-
await
|
|
601
|
+
await require_cache.processCachedTask({
|
|
601
602
|
cache: compilerOptions.cache,
|
|
602
603
|
cacheKey,
|
|
603
604
|
hashKey,
|
|
@@ -732,7 +733,7 @@ async function processWebpackGeneratedCssAsset(element, context) {
|
|
|
732
733
|
const shouldSkipPlainNonMainCssGeneration = !cssHandlerOptions.isMainChunk && sourceCss !== void 0 && !hasExplicitSourceCssForCurrentAsset && !hasExplicitTailwindV4SourceCss && !currentAssetHasTailwindDirectives;
|
|
733
734
|
const shouldMergeFallbackGeneratorRuntime = cssHandlerOptions.isMainChunk || currentAssetHasTailwindDirectives || hasExplicitSourceCssForCurrentAsset;
|
|
734
735
|
const scopedFallbackGeneratorRuntimeSet = hasExplicitTailwindV4SourceCss || !shouldMergeFallbackGeneratorRuntime ? /* @__PURE__ */ new Set() : fallbackGeneratorRuntimeSet;
|
|
735
|
-
const resolvedScopedGeneratorRuntimeSet = await
|
|
736
|
+
const resolvedScopedGeneratorRuntimeSet = await require_scoped_generator.createScopedGeneratorRuntime({
|
|
736
737
|
cssHandlerOptions,
|
|
737
738
|
fallbackRuntime: scopedFallbackGeneratorRuntimeSet,
|
|
738
739
|
getSourceCandidatesForEntries: webpackSourceCandidates?.getSourceCandidatesForEntries,
|
|
@@ -838,7 +839,7 @@ function applyWebpackAssetEmissionPlan(plan, options) {
|
|
|
838
839
|
function buildWebpackBundleSnapshot(assets, opts, state, compilation, options = {}) {
|
|
839
840
|
const entries = [];
|
|
840
841
|
for (const [file, asset] of Object.entries(assets)) {
|
|
841
|
-
const type =
|
|
842
|
+
const type = require_scoped_generator.classifyRuntimeEntry(file, opts);
|
|
842
843
|
if (type !== "html" && type !== "js") continue;
|
|
843
844
|
const source = stringifyWebpackSource(compilation?.getAsset(file)?.source.source() ?? asset.source());
|
|
844
845
|
entries.push({
|
|
@@ -851,9 +852,9 @@ function buildWebpackBundleSnapshot(assets, opts, state, compilation, options =
|
|
|
851
852
|
const currentFiles = new Set(entries.map((entry) => entry.file));
|
|
852
853
|
const removedFiles = new Set(options.removedFiles);
|
|
853
854
|
for (const file of state.sourceHashByFile.keys()) if (!currentFiles.has(file)) removedFiles.add(file);
|
|
854
|
-
return
|
|
855
|
+
return require_cache.buildRuntimeCompilationSnapshot(entries, state, {
|
|
855
856
|
computeHash: (source) => opts.cache.computeHash(source),
|
|
856
|
-
createRuntimeAffectingSignature:
|
|
857
|
+
createRuntimeAffectingSignature: require_compiler.createRuntimeAffectingSourceSignature,
|
|
857
858
|
removedFiles
|
|
858
859
|
});
|
|
859
860
|
}
|
|
@@ -871,7 +872,7 @@ function createWebpackAssetUpdater(options) {
|
|
|
871
872
|
return stringifyWebpackSource(asset.source.source());
|
|
872
873
|
};
|
|
873
874
|
const updateAssetIfChanged = (file, source, { compare = true, notifyUpdate = true } = {}) => {
|
|
874
|
-
const plan = new
|
|
875
|
+
const plan = new require_compiler.AssetEmissionPlan();
|
|
875
876
|
plan.write(file, source);
|
|
876
877
|
if (!compare) {
|
|
877
878
|
applyWebpackAssetEmissionPlan(plan, {
|
|
@@ -917,7 +918,7 @@ async function enqueueWebpackHtmlAndJsTasks(context) {
|
|
|
917
918
|
rememberProcessCacheKey(cacheKey, hashKey);
|
|
918
919
|
const chunkHash = assetHashByChunk.get(file);
|
|
919
920
|
await enqueueTask(async () => {
|
|
920
|
-
await
|
|
921
|
+
await require_cache.processCachedTask({
|
|
921
922
|
cache: compilerOptions.cache,
|
|
922
923
|
cacheKey,
|
|
923
924
|
hashKey,
|
|
@@ -957,7 +958,7 @@ async function enqueueWebpackHtmlAndJsTasks(context) {
|
|
|
957
958
|
const chunkHash = assetHashByChunk.get(file);
|
|
958
959
|
const outputModuleGraphOptions = chunkHash === void 0 ? moduleGraphOptions : void 0;
|
|
959
960
|
await enqueueJsTask(async () => {
|
|
960
|
-
await
|
|
961
|
+
await require_cache.processCachedTask({
|
|
961
962
|
cache: compilerOptions.cache,
|
|
962
963
|
cacheKey,
|
|
963
964
|
hashKey,
|
|
@@ -1038,7 +1039,7 @@ function createWebpackJsAssetModuleGraph(options) {
|
|
|
1038
1039
|
}
|
|
1039
1040
|
function applyWebpackLinkedJsResults(options) {
|
|
1040
1041
|
if (!options.linked) return;
|
|
1041
|
-
const plan = new
|
|
1042
|
+
const plan = new require_compiler.AssetEmissionPlan();
|
|
1042
1043
|
const updates = [];
|
|
1043
1044
|
for (const [id, { code }] of Object.entries(options.linked)) {
|
|
1044
1045
|
const assetName = options.jsAssets.get(id);
|
|
@@ -1123,7 +1124,7 @@ async function processWebpackProcessedCssAsset(element, context) {
|
|
|
1123
1124
|
const sourceHash = processedAssetSourceHash;
|
|
1124
1125
|
rememberProcessCacheKey(file, hashKey);
|
|
1125
1126
|
await enqueueTask(async () => {
|
|
1126
|
-
await
|
|
1127
|
+
await require_cache.processCachedTask({
|
|
1127
1128
|
cache: compilerOptions.cache,
|
|
1128
1129
|
cacheKey: file,
|
|
1129
1130
|
hashKey,
|
|
@@ -1182,7 +1183,7 @@ async function processWebpackProcessedCssAsset(element, context) {
|
|
|
1182
1183
|
const hashKey = `${file}:asset`;
|
|
1183
1184
|
rememberProcessCacheKey(file, hashKey);
|
|
1184
1185
|
await enqueueTask(async () => {
|
|
1185
|
-
await
|
|
1186
|
+
await require_cache.processCachedTask({
|
|
1186
1187
|
cache: compilerOptions.cache,
|
|
1187
1188
|
cacheKey: file,
|
|
1188
1189
|
hashKey,
|
|
@@ -1420,7 +1421,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1420
1421
|
const cssHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
1421
1422
|
const cssUserHandlerOptionsCache = /* @__PURE__ */ new Map();
|
|
1422
1423
|
const webpackSourceCandidateScanCache = createWebpackSourceCandidateScanCache();
|
|
1423
|
-
const bundleBuildState =
|
|
1424
|
+
const bundleBuildState = require_cache.createRuntimeCompilationBuildState();
|
|
1424
1425
|
const bundleRuntimeClassSetManager = runtimeClassSetManager ?? require_hmr_timing.createRuntimeClassSetManager();
|
|
1425
1426
|
const escapeFragments = require_v4_generation_core.createEscapeFragments(_weapp_core_escape.MappingChars2String);
|
|
1426
1427
|
const processedCssAssetSkipDecisionCache = /* @__PURE__ */ new Map();
|
|
@@ -1433,7 +1434,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1433
1434
|
if (entries.length === 0) return;
|
|
1434
1435
|
const groupedEntries = require_utils.getGroupedEntries(entries, compilerOptions);
|
|
1435
1436
|
if (isWebGeneratorTarget && groupedEntries.css.length === 0) return;
|
|
1436
|
-
|
|
1437
|
+
require_compiler.beginCompilerShadowRun(runtimeState);
|
|
1437
1438
|
compilerOptions.onStart();
|
|
1438
1439
|
debug("start");
|
|
1439
1440
|
await runtimeState.readyPromise;
|
|
@@ -1469,9 +1470,9 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1469
1470
|
cssMatcher: compilerOptions.cssMatcher
|
|
1470
1471
|
}));
|
|
1471
1472
|
const watchChangedFiles = new Set([...getWatchChangedFiles?.() ?? []].map((file) => node_path.default.resolve(file)));
|
|
1472
|
-
const compilationChanges =
|
|
1473
|
-
const affectedCompilationScopes =
|
|
1474
|
-
const getCompilationDependencyRevision = (scopeId) =>
|
|
1473
|
+
const compilationChanges = require_compiler.createCompilationDependencyChanges(watchChangedFiles);
|
|
1474
|
+
const affectedCompilationScopes = require_compiler.recordCompilationDependencyChanges(runtimeState, compilationChanges);
|
|
1475
|
+
const getCompilationDependencyRevision = (scopeId) => require_compiler.getCompilationScopeDependencyRevision(runtimeState, scopeId);
|
|
1475
1476
|
const taskConcurrency = watchMode ? require_v4_generation_core.resolveTaskConcurrency(1) : void 0;
|
|
1476
1477
|
const activeProcessCacheKeys = /* @__PURE__ */ new Set();
|
|
1477
1478
|
const activeProcessHashKeys = /* @__PURE__ */ new Set();
|
|
@@ -1514,7 +1515,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1514
1515
|
watchChangedFiles,
|
|
1515
1516
|
watchMode
|
|
1516
1517
|
}) : void 0;
|
|
1517
|
-
const webpackSourceCandidateValueSignature = webpackSourceCandidates ?
|
|
1518
|
+
const webpackSourceCandidateValueSignature = webpackSourceCandidates ? require_scoped_generator.createCandidateSignature(webpackSourceCandidates.getSourceCandidatesForEntries(void 0)) : "source-candidates:0";
|
|
1518
1519
|
recordTimingDetail("sourceCandidates", sourceCandidatesStartedAt);
|
|
1519
1520
|
const cssSourceTraceTokenSources = require_pipeline_helpers.createWebpackCssSourceTraceTokenSources(compilerOptions, webpackSourceCandidates);
|
|
1520
1521
|
const cssSourceTraceSignature = require_v4_generation_core.createCssSourceTraceCacheSignature(cssSourceTraceTokenSources, compilerOptions);
|
|
@@ -1539,7 +1540,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1539
1540
|
const baseRuntimeSet = require_pipeline_helpers.getRuntimeClassSetSync(runtimeState.tailwindRuntime);
|
|
1540
1541
|
const snapshot = buildWebpackBundleSnapshot(assets, compilerOptions, bundleBuildState, compilation);
|
|
1541
1542
|
if (bundleBuildState.iteration === 0) for (const entry of snapshot.entries) snapshot.runtimeAffectingChangedByType[entry.type].add(entry.file);
|
|
1542
|
-
runtimeAffectingSourceHash =
|
|
1543
|
+
runtimeAffectingSourceHash = require_cache.createRuntimeCompilationAffectingSignature(snapshot, (source) => compilerOptions.cache.computeHash(source));
|
|
1543
1544
|
try {
|
|
1544
1545
|
runtimeSet = await bundleRuntimeClassSetManager.sync(runtimeState.tailwindRuntime, snapshot, {
|
|
1545
1546
|
baseClassSet: baseRuntimeSet,
|
|
@@ -1551,11 +1552,11 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
1551
1552
|
runtimeSet = require_pipeline_helpers.getRuntimeClassSetSync(runtimeState.tailwindRuntime);
|
|
1552
1553
|
}
|
|
1553
1554
|
releaseWebpackBundleSnapshotSources(snapshot);
|
|
1554
|
-
|
|
1555
|
+
require_cache.updateRuntimeCompilationBuildState(bundleBuildState, snapshot, /* @__PURE__ */ new Map(), { incremental: true });
|
|
1555
1556
|
} else {
|
|
1556
1557
|
if (forceRuntimeRefresh) {
|
|
1557
1558
|
await bundleRuntimeClassSetManager.reset();
|
|
1558
|
-
|
|
1559
|
+
require_cache.resetRuntimeCompilationBuildState(bundleBuildState);
|
|
1559
1560
|
}
|
|
1560
1561
|
runtimeSet = await require_compiler.ensureRuntimeClassSet(runtimeState, {
|
|
1561
1562
|
forceRefresh: forceRuntimeRefresh,
|
|
@@ -2181,7 +2182,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
2181
2182
|
});
|
|
2182
2183
|
const cleanupWebpackLoaderRuntime = () => {
|
|
2183
2184
|
require_runtime_registry.deleteWebpackLoaderRuntime(runtimeRegistryKey);
|
|
2184
|
-
|
|
2185
|
+
require_compiler.disposeCompilerOwner(runtimeState);
|
|
2185
2186
|
};
|
|
2186
2187
|
compiler.hooks.watchClose?.tap?.(require_compiler.pluginName, cleanupWebpackLoaderRuntime);
|
|
2187
2188
|
compiler.hooks.shutdown?.tap?.(require_compiler.pluginName, cleanupWebpackLoaderRuntime);
|
|
@@ -2283,7 +2284,7 @@ function setupWebpackV5Loaders(options) {
|
|
|
2283
2284
|
}
|
|
2284
2285
|
//#endregion
|
|
2285
2286
|
//#region src/bundlers/webpack/shared/create-framework-plugin/watch-output.ts
|
|
2286
|
-
const debug =
|
|
2287
|
+
const debug = require_compiler.createDebug();
|
|
2287
2288
|
const weappTailwindcssPackageDir = require_source_candidate_scan_signature.resolvePackageDir("weapp-tailwindcss");
|
|
2288
2289
|
const outputIgnoredPredicatePath = Symbol("weapp-tailwindcss.outputIgnoredPredicatePath");
|
|
2289
2290
|
function shouldKeepPreviousWebpackCssSource(previous, next) {
|
|
@@ -2355,10 +2356,10 @@ function isInternalUserDefinedOptions(options) {
|
|
|
2355
2356
|
}
|
|
2356
2357
|
var WebpackFrameworkPlugin = class {
|
|
2357
2358
|
constructor(options = {}, frameworkBranch) {
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2359
|
+
require_generator._defineProperty(this, "options", void 0);
|
|
2360
|
+
require_generator._defineProperty(this, "appType", void 0);
|
|
2361
|
+
require_generator._defineProperty(this, "hasInitialTailwindCssRoots", void 0);
|
|
2362
|
+
require_generator._defineProperty(this, "frameworkBranch", void 0);
|
|
2362
2363
|
this.frameworkBranch = frameworkBranch;
|
|
2363
2364
|
this.hasInitialTailwindCssRoots = require_generator.hasConfiguredTailwindV4CssRoots(options);
|
|
2364
2365
|
this.options = isInternalUserDefinedOptions(options) ? options : require_compiler.getCompilerContext({
|
|
@@ -2373,9 +2374,9 @@ var WebpackFrameworkPlugin = class {
|
|
|
2373
2374
|
const { disabled, onLoad, runtimeLoaderPath, tailwindRuntime, refreshTailwindcssRuntime, styleInjector } = this.options;
|
|
2374
2375
|
const initialTailwindRuntime = tailwindRuntime;
|
|
2375
2376
|
const refreshTailwindRuntime = refreshTailwindcssRuntime;
|
|
2376
|
-
const disabledOptions =
|
|
2377
|
+
const disabledOptions = require_scoped_generator.resolvePluginDisabledState(disabled);
|
|
2377
2378
|
const shouldRewriteCssImports = this.options.rewriteCssImports === true;
|
|
2378
|
-
const frameworkProfile =
|
|
2379
|
+
const frameworkProfile = require_scoped_generator.resolveWebpackFrameworkProfile({
|
|
2379
2380
|
appType: this.appType,
|
|
2380
2381
|
detectEnv: true,
|
|
2381
2382
|
env: node_process.default.env,
|
|
@@ -2387,11 +2388,12 @@ var WebpackFrameworkPlugin = class {
|
|
|
2387
2388
|
if (disabledOptions.plugin) return;
|
|
2388
2389
|
if (initialTailwindRuntime.majorVersion !== 4) throw new Error("weapp-tailwindcss/webpack 新生成管线仅支持 Tailwind CSS v4,请升级 tailwindcss 或停留在旧版 weapp-tailwindcss。");
|
|
2389
2390
|
setupWebpackWatchOutputIgnore(compiler);
|
|
2390
|
-
const
|
|
2391
|
+
const readyPromise = require_compiler.createTailwindRuntimeReadyPromise(initialTailwindRuntime);
|
|
2392
|
+
const runtimeState = require_runtime_state.createCompilerRuntimeState({
|
|
2391
2393
|
tailwindRuntime: initialTailwindRuntime,
|
|
2392
|
-
readyPromise
|
|
2394
|
+
readyPromise,
|
|
2393
2395
|
refreshTailwindcssRuntime: refreshTailwindRuntime
|
|
2394
|
-
};
|
|
2396
|
+
});
|
|
2395
2397
|
let runtimeSetPrepared = false;
|
|
2396
2398
|
let runtimeSetSignature;
|
|
2397
2399
|
let runtimeRefreshRequiredForCompilation = false;
|
|
@@ -2617,7 +2619,7 @@ var WebpackFrameworkPlugin = class {
|
|
|
2617
2619
|
prepareWebpackCssSources,
|
|
2618
2620
|
debug
|
|
2619
2621
|
});
|
|
2620
|
-
|
|
2622
|
+
require_scoped_generator.createBuiltinWebpackStyleInjectorPlugin(styleInjector, this.frameworkBranch.styleInjectorDelegate)?.apply(compiler);
|
|
2621
2623
|
}
|
|
2622
2624
|
};
|
|
2623
2625
|
//#endregion
|
|
@@ -2627,7 +2629,7 @@ var GenericWebpackPlugin = class extends WebpackFrameworkPlugin {
|
|
|
2627
2629
|
super(options, {
|
|
2628
2630
|
frameworkName: "generic",
|
|
2629
2631
|
loaderAnchorFinders: createDefaultLoaderAnchorFinders(),
|
|
2630
|
-
styleInjectorDelegate:
|
|
2632
|
+
styleInjectorDelegate: require_scoped_generator.webpackStyleInjectorDelegates.generic
|
|
2631
2633
|
});
|
|
2632
2634
|
}
|
|
2633
2635
|
};
|
|
@@ -2640,7 +2642,7 @@ var MpxWebpackPlugin = class extends WebpackFrameworkPlugin {
|
|
|
2640
2642
|
loaderAnchorFinders: createMpxLoaderAnchorFinders(),
|
|
2641
2643
|
mpxCssImportRewrite: true,
|
|
2642
2644
|
setupCssImportRewriteRedirect: (packageDir) => setupMpxTailwindcssRedirect(packageDir, true),
|
|
2643
|
-
styleInjectorDelegate:
|
|
2645
|
+
styleInjectorDelegate: require_scoped_generator.webpackStyleInjectorDelegates.mpx
|
|
2644
2646
|
});
|
|
2645
2647
|
}
|
|
2646
2648
|
};
|
|
@@ -2651,7 +2653,7 @@ var TaroWebpackPlugin = class extends WebpackFrameworkPlugin {
|
|
|
2651
2653
|
super(options, {
|
|
2652
2654
|
frameworkName: "taro",
|
|
2653
2655
|
loaderAnchorFinders: createDefaultLoaderAnchorFinders(),
|
|
2654
|
-
styleInjectorDelegate:
|
|
2656
|
+
styleInjectorDelegate: require_scoped_generator.webpackStyleInjectorDelegates.taro
|
|
2655
2657
|
});
|
|
2656
2658
|
}
|
|
2657
2659
|
};
|
|
@@ -2662,7 +2664,7 @@ var UniAppWebpackPlugin = class extends WebpackFrameworkPlugin {
|
|
|
2662
2664
|
super(options, {
|
|
2663
2665
|
frameworkName: "uni-app",
|
|
2664
2666
|
loaderAnchorFinders: createDefaultLoaderAnchorFinders(),
|
|
2665
|
-
styleInjectorDelegate:
|
|
2667
|
+
styleInjectorDelegate: require_scoped_generator.webpackStyleInjectorDelegates.uniApp
|
|
2666
2668
|
});
|
|
2667
2669
|
}
|
|
2668
2670
|
};
|
|
@@ -2673,7 +2675,7 @@ var WeappViteWebpackPlugin = class extends WebpackFrameworkPlugin {
|
|
|
2673
2675
|
super(options, {
|
|
2674
2676
|
frameworkName: "weapp-vite",
|
|
2675
2677
|
loaderAnchorFinders: createDefaultLoaderAnchorFinders(),
|
|
2676
|
-
styleInjectorDelegate:
|
|
2678
|
+
styleInjectorDelegate: require_scoped_generator.webpackStyleInjectorDelegates.generic
|
|
2677
2679
|
});
|
|
2678
2680
|
}
|
|
2679
2681
|
};
|
|
@@ -2697,8 +2699,8 @@ function createWebpackFrameworkPlugin(frameworkName, options = {}) {
|
|
|
2697
2699
|
*/
|
|
2698
2700
|
var WeappTailwindcss = class {
|
|
2699
2701
|
constructor(options = {}) {
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
+
require_generator._defineProperty(this, "options", void 0);
|
|
2703
|
+
require_generator._defineProperty(this, "appType", void 0);
|
|
2702
2704
|
this.options = require_compiler.getCompilerContext({
|
|
2703
2705
|
...options,
|
|
2704
2706
|
__internalDeferMissingCssEntriesWarning: true
|
|
@@ -2706,7 +2708,7 @@ var WeappTailwindcss = class {
|
|
|
2706
2708
|
this.appType = this.options.appType;
|
|
2707
2709
|
}
|
|
2708
2710
|
apply(compiler) {
|
|
2709
|
-
const plugin = createWebpackFrameworkPlugin(
|
|
2711
|
+
const plugin = createWebpackFrameworkPlugin(require_scoped_generator.resolveWebpackFrameworkProfile({
|
|
2710
2712
|
appType: this.appType,
|
|
2711
2713
|
detectEnv: true,
|
|
2712
2714
|
env: node_process.default.env,
|
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-Ce04-btG.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-7Um2GFtx.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.
|
|
4
|
+
"version": "5.5.1",
|
|
5
5
|
"description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -56,6 +56,11 @@
|
|
|
56
56
|
"import": "./dist/vite.js",
|
|
57
57
|
"require": "./dist/vite.cjs"
|
|
58
58
|
},
|
|
59
|
+
"./vite/web": {
|
|
60
|
+
"types": "./dist/vite/web.d.ts",
|
|
61
|
+
"import": "./dist/vite/web.js",
|
|
62
|
+
"require": "./dist/vite/web.cjs"
|
|
63
|
+
},
|
|
59
64
|
"./webpack": {
|
|
60
65
|
"types": "./dist/webpack.d.ts",
|
|
61
66
|
"import": "./dist/webpack.js",
|
|
@@ -184,11 +189,15 @@
|
|
|
184
189
|
"registry": "https://registry.npmjs.org"
|
|
185
190
|
},
|
|
186
191
|
"peerDependencies": {
|
|
187
|
-
"@mpxjs/webpack-plugin": ">=2.0.0 <3.0.0"
|
|
192
|
+
"@mpxjs/webpack-plugin": ">=2.0.0 <3.0.0",
|
|
193
|
+
"vite": "^5.2.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
188
194
|
},
|
|
189
195
|
"peerDependenciesMeta": {
|
|
190
196
|
"@mpxjs/webpack-plugin": {
|
|
191
197
|
"optional": true
|
|
198
|
+
},
|
|
199
|
+
"vite": {
|
|
200
|
+
"optional": true
|
|
192
201
|
}
|
|
193
202
|
},
|
|
194
203
|
"dependencies": {
|
|
@@ -199,7 +208,7 @@
|
|
|
199
208
|
"@vue/compiler-dom": "^3.5.41",
|
|
200
209
|
"@weapp-core/escape": "~8.0.0",
|
|
201
210
|
"@weapp-tailwindcss/logger": "2.0.3",
|
|
202
|
-
"@weapp-tailwindcss/postcss": "3.3.
|
|
211
|
+
"@weapp-tailwindcss/postcss": "3.3.2",
|
|
203
212
|
"@weapp-tailwindcss/reset": "0.1.4",
|
|
204
213
|
"@weapp-tailwindcss/shared": "2.0.3",
|
|
205
214
|
"comment-json": "^5.0.0",
|
|
@@ -211,7 +220,7 @@
|
|
|
211
220
|
"lru-cache": "11.5.2",
|
|
212
221
|
"magic-string": "^1.2.3",
|
|
213
222
|
"micromatch": "^4.0.8",
|
|
214
|
-
"oxc-parser": "^0.
|
|
223
|
+
"oxc-parser": "^0.148.0",
|
|
215
224
|
"oxc-walker": "^1.1.1",
|
|
216
225
|
"semver": "~7.8.5",
|
|
217
226
|
"tailwindcss-config": "2.0.4",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/js/babel/cache-options.ts
|
|
2
|
-
const DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH = 5e4;
|
|
3
|
-
const HARD_PARSE_CACHE_MAX_ENTRIES = 1024;
|
|
4
|
-
//#endregion
|
|
5
|
-
Object.defineProperty(exports, "DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(exports, "HARD_PARSE_CACHE_MAX_ENTRIES", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function() {
|
|
14
|
-
return HARD_PARSE_CACHE_MAX_ENTRIES;
|
|
15
|
-
}
|
|
16
|
-
});
|