weapp-tailwindcss 5.0.0-next.33 → 5.0.0-next.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{bundle-state-Co_ksa-C.js → bundle-state-8w8DM8Lw.js} +1 -1
- package/dist/{bundle-state-DUIidcox.mjs → bundle-state-Bsr05EFW.mjs} +1 -1
- package/dist/bundlers/shared/cache.d.ts +3 -1
- package/dist/cli.js +6 -4
- package/dist/cli.mjs +6 -4
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{generator-BEXaaUzP.js → generator-BtpQoQEH.js} +1 -1
- package/dist/{generator-CpsHA4Wd.mjs → generator-CmLpVJgw.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +5 -5
- package/dist/gulp.mjs +5 -5
- package/dist/{incremental-runtime-class-set-BXYUYjCd.mjs → incremental-runtime-class-set-W61zZU00.mjs} +6 -6
- package/dist/{incremental-runtime-class-set-BE8RVbuz.js → incremental-runtime-class-set-vqTU-eph.js} +11 -5
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/replacement-cache.d.ts +5 -0
- package/dist/{postcss-BvkdIZr8.mjs → postcss-DGprmeke.mjs} +2 -2
- package/dist/{postcss-DN7IQzYb.js → postcss-DSvNrY0J.js} +2 -2
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-D_KT1pis.js → precheck-Bp-V1T_Q.js} +8 -6
- package/dist/{precheck-mM9IVd1f.mjs → precheck-nPDKYr8V.mjs} +8 -6
- package/dist/presets.js +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/{source-candidates-7Q-kTOSb.js → source-candidates-BjB4wSga.js} +1 -1
- package/dist/{source-candidates-_x8bq0Mz.mjs → source-candidates-l12JBkKU.mjs} +1 -1
- package/dist/{tailwindcss-udhXxMX9.mjs → tailwindcss-D6zEhnyE.mjs} +1 -1
- package/dist/{tailwindcss-Cl7hUlYV.js → tailwindcss-bNXguXhC.js} +1 -1
- package/dist/{v3-engine-C_KeUQG3.mjs → v3-engine-BYcGCWUY.mjs} +33 -0
- package/dist/{v3-engine-DwY4Fixu.js → v3-engine-KDOfD-6F.js} +33 -0
- package/dist/{vite-C8vSTuBQ.mjs → vite-C8SUICPv.mjs} +7 -7
- package/dist/{vite-BVbIr2vs.js → vite-CMzi0wR2.js} +7 -7
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +33 -0
- package/dist/{webpack-DlHo84RT.js → webpack-2v1sQKyZ.js} +65 -29
- package/dist/{webpack-dva53gYi.mjs → webpack-pdpdIv_X.mjs} +65 -29
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_precheck = require("./precheck-Bp-V1T_Q.js");
|
|
3
3
|
let node_module = require("node:module");
|
|
4
4
|
let node_process = require("node:process");
|
|
5
5
|
node_process = require_chunk.__toESM(node_process);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as traverse, h as babelParse, o as Parser } from "./precheck-
|
|
1
|
+
import { g as traverse, h as babelParse, o as Parser } from "./precheck-nPDKYr8V.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import path from "node:path";
|
|
@@ -6,7 +6,9 @@ export interface ProcessCachedTaskOptions<TValue extends CacheValue> {
|
|
|
6
6
|
rawSource?: string | undefined;
|
|
7
7
|
hash?: string | undefined;
|
|
8
8
|
readCache?: (() => TValue | undefined) | undefined;
|
|
9
|
-
applyResult: (value: TValue
|
|
9
|
+
applyResult: (value: TValue, meta: {
|
|
10
|
+
cacheHit: boolean;
|
|
11
|
+
}) => void | Promise<void>;
|
|
10
12
|
transform: () => Promise<{
|
|
11
13
|
result: TValue;
|
|
12
14
|
cacheValue?: CacheValue | undefined;
|
package/dist/cli.js
CHANGED
|
@@ -1006,12 +1006,9 @@ function isClassContextLiteralPath(path) {
|
|
|
1006
1006
|
return false;
|
|
1007
1007
|
}
|
|
1008
1008
|
//#endregion
|
|
1009
|
-
//#region src/js/
|
|
1010
|
-
const debug$1 = createDebug("[js:handlers] ");
|
|
1009
|
+
//#region src/js/replacement-cache.ts
|
|
1011
1010
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
1012
1011
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
1013
|
-
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
1014
|
-
const IGNORE_MARKER = "ignore";
|
|
1015
1012
|
function getReplacementCacheStore(escapeMap) {
|
|
1016
1013
|
if (!escapeMap) return defaultReplacementCache;
|
|
1017
1014
|
let store = replacementCacheByEscapeMap.get(escapeMap);
|
|
@@ -1029,6 +1026,11 @@ function getReplacement(candidate, escapeMap, store = getReplacementCacheStore(e
|
|
|
1029
1026
|
}
|
|
1030
1027
|
return cached;
|
|
1031
1028
|
}
|
|
1029
|
+
//#endregion
|
|
1030
|
+
//#region src/js/handlers.ts
|
|
1031
|
+
const debug$1 = createDebug("[js:handlers] ");
|
|
1032
|
+
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
1033
|
+
const IGNORE_MARKER = "ignore";
|
|
1032
1034
|
function hasIgnoreComment(node) {
|
|
1033
1035
|
const { leadingComments } = node;
|
|
1034
1036
|
if (!Array.isArray(leadingComments) || leadingComments.length === 0) return false;
|
package/dist/cli.mjs
CHANGED
|
@@ -977,12 +977,9 @@ function isClassContextLiteralPath(path) {
|
|
|
977
977
|
return false;
|
|
978
978
|
}
|
|
979
979
|
//#endregion
|
|
980
|
-
//#region src/js/
|
|
981
|
-
const debug = createDebug("[js:handlers] ");
|
|
980
|
+
//#region src/js/replacement-cache.ts
|
|
982
981
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
983
982
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
984
|
-
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
985
|
-
const IGNORE_MARKER = "ignore";
|
|
986
983
|
function getReplacementCacheStore(escapeMap) {
|
|
987
984
|
if (!escapeMap) return defaultReplacementCache;
|
|
988
985
|
let store = replacementCacheByEscapeMap.get(escapeMap);
|
|
@@ -1000,6 +997,11 @@ function getReplacement(candidate, escapeMap, store = getReplacementCacheStore(e
|
|
|
1000
997
|
}
|
|
1001
998
|
return cached;
|
|
1002
999
|
}
|
|
1000
|
+
//#endregion
|
|
1001
|
+
//#region src/js/handlers.ts
|
|
1002
|
+
const debug = createDebug("[js:handlers] ");
|
|
1003
|
+
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
1004
|
+
const IGNORE_MARKER = "ignore";
|
|
1003
1005
|
function hasIgnoreComment(node) {
|
|
1004
1006
|
const { leadingComments } = node;
|
|
1005
1007
|
if (!Array.isArray(leadingComments) || leadingComments.length === 0) return false;
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_precheck = require("./precheck-Bp-V1T_Q.js");
|
|
3
3
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
4
4
|
//#region src/core.ts
|
|
5
5
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-
|
|
1
|
+
import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-nPDKYr8V.mjs";
|
|
2
2
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
3
3
|
//#region src/core.ts
|
|
4
4
|
const DEFAULT_MAIN_CHUNK_STYLE_OPTIONS = Object.freeze({ isMainChunk: true });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
3
|
let node_process = require("node:process");
|
|
4
4
|
node_process = require_chunk.__toESM(node_process);
|
|
5
5
|
//#region src/generator/options.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { C as createTailwindV4Engine, i as createTailwindV3Engine, n as resolveTailwindV3SourceFromPatcher, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
//#region src/generator/options.ts
|
|
4
4
|
const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
|
package/dist/generator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
|
+
const require_generator = require("./generator-BtpQoQEH.js");
|
|
4
4
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
5
5
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
6
6
|
exports.createWeappTailwindcssGeneratorFromPatcher = require_generator.createWeappTailwindcssGeneratorFromPatcher;
|
package/dist/generator.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { S as resolveTailwindV4SourceOptionsFromPatcher, T as transformTailwindV4CssToWeapp, a as transformTailwindV3CssByTarget, b as resolveTailwindV4SourceFromPatchOptions, n as resolveTailwindV3SourceFromPatcher, o as transformTailwindV3CssToWeapp, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, w as transformTailwindV4CssByTarget, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromPatcher, r as resolveTailwindSourceFromPatcher, t as createWeappTailwindcssGenerator } from "./generator-CmLpVJgw.mjs";
|
|
3
3
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromPatcher, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromPatcher, resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceOptionsFromPatcher, transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|
package/dist/gulp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
6
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
7
|
-
const require_source_candidates = require("./source-candidates-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-vqTU-eph.js");
|
|
5
|
+
const require_precheck = require("./precheck-Bp-V1T_Q.js");
|
|
6
|
+
const require_tailwindcss = require("./tailwindcss-bNXguXhC.js");
|
|
7
|
+
const require_source_candidates = require("./source-candidates-BjB4wSga.js");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
node_fs = require_chunk.__toESM(node_fs);
|
|
10
10
|
let node_process = require("node:process");
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-
|
|
2
|
-
import { B as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-
|
|
3
|
-
import { c as hasTailwindRootDirectives, i as generateCssByGenerator, r as emitHmrTiming, s as processCachedTask, t as createBundleRuntimeClassSetManager, u as normalizeTailwindSourceForGenerator } from "./incremental-runtime-class-set-
|
|
4
|
-
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
5
|
-
import { t as createSourceCandidateCollector } from "./source-candidates-
|
|
1
|
+
import { b as ensureRuntimeClassSet, n as getCompilerContext, t as shouldSkipJsTransform, y as createTailwindRuntimeReadyPromise } from "./precheck-nPDKYr8V.mjs";
|
|
2
|
+
import { B as createDebug, _ as resolveViteSourceScanEntries, l as getRuntimeClassSetSignature } from "./v3-engine-BYcGCWUY.mjs";
|
|
3
|
+
import { c as hasTailwindRootDirectives, i as generateCssByGenerator, r as emitHmrTiming, s as processCachedTask, t as createBundleRuntimeClassSetManager, u as normalizeTailwindSourceForGenerator } from "./incremental-runtime-class-set-W61zZU00.mjs";
|
|
4
|
+
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-D6zEhnyE.mjs";
|
|
5
|
+
import { t as createSourceCandidateCollector } from "./source-candidates-l12JBkKU.mjs";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import path from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-
|
|
2
|
-
import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-
|
|
3
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-nPDKYr8V.mjs";
|
|
2
|
+
import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-BYcGCWUY.mjs";
|
|
3
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-CmLpVJgw.mjs";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import postcss from "postcss";
|
|
6
6
|
import process from "node:process";
|
|
@@ -478,12 +478,12 @@ async function processCachedTask({ cache, cacheKey, hashKey = cacheKey, rawSourc
|
|
|
478
478
|
resolveCache: readCache,
|
|
479
479
|
async onCacheHit(value) {
|
|
480
480
|
cacheHit = true;
|
|
481
|
-
await applyResult(value);
|
|
481
|
+
await applyResult(value, { cacheHit: true });
|
|
482
482
|
onCacheHit?.();
|
|
483
483
|
},
|
|
484
484
|
transform
|
|
485
485
|
});
|
|
486
|
-
if (!cacheHit) await applyResult(result);
|
|
486
|
+
if (!cacheHit) await applyResult(result, { cacheHit: false });
|
|
487
487
|
}
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/bundlers/shared/generator-css/legacy-selectors.ts
|
|
@@ -2283,4 +2283,4 @@ function createBundleRuntimeClassSetManager(options = {}) {
|
|
|
2283
2283
|
};
|
|
2284
2284
|
}
|
|
2285
2285
|
//#endregion
|
|
2286
|
-
export { validateCandidatesByGenerator as a, hasTailwindRootDirectives as c,
|
|
2286
|
+
export { validateCandidatesByGenerator as a, hasTailwindRootDirectives as c, removeTailwindSourceDirectives as d, hasTailwindGeneratedCssMarkers as f, generateCssByGenerator as i, hasTailwindSourceDirectives as l, createHmrTimingRecorder as n, mergeMarkedUserLayerComponentsCss as o, emitHmrTiming as r, processCachedTask as s, createBundleRuntimeClassSetManager as t, normalizeTailwindSourceForGenerator as u };
|
package/dist/{incremental-runtime-class-set-BE8RVbuz.js → incremental-runtime-class-set-vqTU-eph.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
|
+
const require_generator = require("./generator-BtpQoQEH.js");
|
|
4
|
+
const require_precheck = require("./precheck-Bp-V1T_Q.js");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
6
6
|
let postcss = require("postcss");
|
|
7
7
|
postcss = require_chunk.__toESM(postcss);
|
|
@@ -482,12 +482,12 @@ async function processCachedTask({ cache, cacheKey, hashKey = cacheKey, rawSourc
|
|
|
482
482
|
resolveCache: readCache,
|
|
483
483
|
async onCacheHit(value) {
|
|
484
484
|
cacheHit = true;
|
|
485
|
-
await applyResult(value);
|
|
485
|
+
await applyResult(value, { cacheHit: true });
|
|
486
486
|
onCacheHit?.();
|
|
487
487
|
},
|
|
488
488
|
transform
|
|
489
489
|
});
|
|
490
|
-
if (!cacheHit) await applyResult(result);
|
|
490
|
+
if (!cacheHit) await applyResult(result, { cacheHit: false });
|
|
491
491
|
}
|
|
492
492
|
//#endregion
|
|
493
493
|
//#region src/bundlers/shared/generator-css/legacy-selectors.ts
|
|
@@ -2347,6 +2347,12 @@ Object.defineProperty(exports, "processCachedTask", {
|
|
|
2347
2347
|
return processCachedTask;
|
|
2348
2348
|
}
|
|
2349
2349
|
});
|
|
2350
|
+
Object.defineProperty(exports, "removeTailwindSourceDirectives", {
|
|
2351
|
+
enumerable: true,
|
|
2352
|
+
get: function() {
|
|
2353
|
+
return removeTailwindSourceDirectives;
|
|
2354
|
+
}
|
|
2355
|
+
});
|
|
2350
2356
|
Object.defineProperty(exports, "validateCandidatesByGenerator", {
|
|
2351
2357
|
enumerable: true,
|
|
2352
2358
|
get: function() {
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-BtpQoQEH.js");
|
|
3
3
|
const require_gulp = require("./gulp.js");
|
|
4
|
-
const require_postcss = require("./postcss-
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
4
|
+
const require_postcss = require("./postcss-DSvNrY0J.js");
|
|
5
|
+
const require_vite = require("./vite-CMzi0wR2.js");
|
|
6
|
+
const require_webpack = require("./webpack-2v1sQKyZ.js");
|
|
7
7
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
8
8
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
9
9
|
exports.createPlugins = require_gulp.createPlugins;
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-CmLpVJgw.mjs";
|
|
2
2
|
import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
|
|
3
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
3
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-DGprmeke.mjs";
|
|
4
|
+
import { t as WeappTailwindcss } from "./vite-C8SUICPv.mjs";
|
|
5
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-pdpdIv_X.mjs";
|
|
6
6
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
7
7
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { IJsHandlerOptions } from '../types';
|
|
2
|
+
type EscapeMap = NonNullable<IJsHandlerOptions['escapeMap']>;
|
|
3
|
+
export declare function getReplacementCacheStore(escapeMap?: EscapeMap): Map<string, string>;
|
|
4
|
+
export declare function getReplacement(candidate: string, escapeMap: EscapeMap | undefined, store?: Map<string, string>): string;
|
|
5
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as collectCssInlineSourceCandidates, F as parseConfigParam, H as readInstalledPackageMajorVersion, I as resolveCssSourceEntries, M as expandTailwindSourceEntries, O as DEFAULT_SOURCE_SCAN_EXTENSIONS, P as normalizeLegacyContentEntries, j as createSourceScanPattern, t as resolveTailwindV3Source, y as resolveTailwindV4Source$1 } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { A as collectCssInlineSourceCandidates, F as parseConfigParam, H as readInstalledPackageMajorVersion, I as resolveCssSourceEntries, M as expandTailwindSourceEntries, O as DEFAULT_SOURCE_SCAN_EXTENSIONS, P as normalizeLegacyContentEntries, j as createSourceScanPattern, t as resolveTailwindV3Source, y as resolveTailwindV4Source$1 } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-CmLpVJgw.mjs";
|
|
3
3
|
import postcss from "postcss";
|
|
4
4
|
import process from "node:process";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
|
+
const require_generator = require("./generator-BtpQoQEH.js");
|
|
4
4
|
let postcss = require("postcss");
|
|
5
5
|
postcss = require_chunk.__toESM(postcss);
|
|
6
6
|
let node_process = require("node:process");
|
package/dist/postcss.js
CHANGED
|
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_postcss = require("./postcss-
|
|
5
|
+
const require_postcss = require("./postcss-DSvNrY0J.js");
|
|
6
6
|
exports.default = require_postcss.weappTailwindcssPostcssPlugin;
|
|
7
7
|
exports.weappTailwindcssPostcssPlugin = require_postcss.weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
1
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-DGprmeke.mjs";
|
|
2
2
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
3
|
const require_defaults = require("./defaults-zKUH2mDe.js");
|
|
4
4
|
require("./utils-D7Ygohep.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-bNXguXhC.js");
|
|
6
6
|
let node_process = require("node:process");
|
|
7
7
|
node_process = require_chunk.__toESM(node_process);
|
|
8
8
|
let node_path = require("node:path");
|
|
@@ -888,12 +888,9 @@ function isClassContextLiteralPath(path) {
|
|
|
888
888
|
return false;
|
|
889
889
|
}
|
|
890
890
|
//#endregion
|
|
891
|
-
//#region src/js/
|
|
892
|
-
const debug = require_v3_engine.createDebug("[js:handlers] ");
|
|
891
|
+
//#region src/js/replacement-cache.ts
|
|
893
892
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
894
893
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
895
|
-
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
896
|
-
const IGNORE_MARKER = "ignore";
|
|
897
894
|
function getReplacementCacheStore(escapeMap) {
|
|
898
895
|
if (!escapeMap) return defaultReplacementCache;
|
|
899
896
|
let store = replacementCacheByEscapeMap.get(escapeMap);
|
|
@@ -911,6 +908,11 @@ function getReplacement(candidate, escapeMap, store = getReplacementCacheStore(e
|
|
|
911
908
|
}
|
|
912
909
|
return cached;
|
|
913
910
|
}
|
|
911
|
+
//#endregion
|
|
912
|
+
//#region src/js/handlers.ts
|
|
913
|
+
const debug = require_v3_engine.createDebug("[js:handlers] ");
|
|
914
|
+
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
915
|
+
const IGNORE_MARKER = "ignore";
|
|
914
916
|
function hasIgnoreComment(node) {
|
|
915
917
|
const { leadingComments } = node;
|
|
916
918
|
if (!Array.isArray(leadingComments) || leadingComments.length === 0) return false;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as createDebug, C as createTailwindV4Engine$1, K as resolveBooleanObjectOption, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, q as omitUndefined, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { B as createDebug, C as createTailwindV4Engine$1, K as resolveBooleanObjectOption, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, q as omitUndefined, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
2
|
import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-8xrgzxFY.mjs";
|
|
3
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
4
|
-
import { a as applyV4CssCalcDefaults, i as resolveUniAppXOptions, o as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-
|
|
4
|
+
import { a as applyV4CssCalcDefaults, i as resolveUniAppXOptions, o as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-D6zEhnyE.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import process from "node:process";
|
|
7
7
|
import path from "node:path";
|
|
@@ -887,12 +887,9 @@ function isClassContextLiteralPath(path) {
|
|
|
887
887
|
return false;
|
|
888
888
|
}
|
|
889
889
|
//#endregion
|
|
890
|
-
//#region src/js/
|
|
891
|
-
const debug = createDebug("[js:handlers] ");
|
|
890
|
+
//#region src/js/replacement-cache.ts
|
|
892
891
|
const replacementCacheByEscapeMap = /* @__PURE__ */ new WeakMap();
|
|
893
892
|
const defaultReplacementCache = /* @__PURE__ */ new Map();
|
|
894
|
-
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
895
|
-
const IGNORE_MARKER = "ignore";
|
|
896
893
|
function getReplacementCacheStore(escapeMap) {
|
|
897
894
|
if (!escapeMap) return defaultReplacementCache;
|
|
898
895
|
let store = replacementCacheByEscapeMap.get(escapeMap);
|
|
@@ -910,6 +907,11 @@ function getReplacement(candidate, escapeMap, store = getReplacementCacheStore(e
|
|
|
910
907
|
}
|
|
911
908
|
return cached;
|
|
912
909
|
}
|
|
910
|
+
//#endregion
|
|
911
|
+
//#region src/js/handlers.ts
|
|
912
|
+
const debug = createDebug("[js:handlers] ");
|
|
913
|
+
const WEAPP_TW_IGNORE_MARKER = "weapp-tw";
|
|
914
|
+
const IGNORE_MARKER = "ignore";
|
|
913
915
|
function hasIgnoreComment(node) {
|
|
914
916
|
const { leadingComments } = node;
|
|
915
917
|
if (!Array.isArray(leadingComments) || leadingComments.length === 0) return false;
|
package/dist/presets.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
4
4
|
const require_utils = require("./utils-D7Ygohep.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-bNXguXhC.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
7
|
let node_process = require("node:process");
|
|
8
8
|
node_process = require_chunk.__toESM(node_process);
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { q as omitUndefined } from "./v3-engine-
|
|
1
|
+
import { q as omitUndefined } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
2
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-D6zEhnyE.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_chunk.__toESM(node_path);
|
|
5
5
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as resolveSourceScanPath, N as isFileMatchedByTailwindSourceEntries, k as FULL_SOURCE_SCAN_EXTENSION_RE, z as toPosixPath } from "./v3-engine-
|
|
1
|
+
import { L as resolveSourceScanPath, N as isFileMatchedByTailwindSourceEntries, k as FULL_SOURCE_SCAN_EXTENSION_RE, z as toPosixPath } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { extractSourceCandidates, resolveProjectSourceFiles } from "tailwindcss-patch";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as normalizeStringListOption, H as readInstalledPackageMajorVersion, J as findNearestPackageRoot, V as createTailwindcssPatcher, X as findWorkspaceRoot, Y as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, q as omitUndefined } from "./v3-engine-
|
|
1
|
+
import { G as normalizeStringListOption, H as readInstalledPackageMajorVersion, J as findNearestPackageRoot, V as createTailwindcssPatcher, X as findWorkspaceRoot, Y as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, q as omitUndefined } from "./v3-engine-BYcGCWUY.mjs";
|
|
2
2
|
import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
3
|
require("./utils-D7Ygohep.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_module = require("node:module");
|
|
@@ -1547,6 +1547,10 @@ function applyMiniProgramTailwindV4DefaultColorCss(css) {
|
|
|
1547
1547
|
function collectCandidates$1(candidates) {
|
|
1548
1548
|
return new Set(candidates ?? []);
|
|
1549
1549
|
}
|
|
1550
|
+
function hasRemovedCandidates$1(previousCandidates, nextCandidates) {
|
|
1551
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
1552
|
+
return false;
|
|
1553
|
+
}
|
|
1550
1554
|
function normalizeRpxTextCandidate(candidate) {
|
|
1551
1555
|
return candidate.replace(BARE_RPX_TEXT_CANDIDATE_RE, "$1text-[length:$2]$3");
|
|
1552
1556
|
}
|
|
@@ -1859,6 +1863,18 @@ function createTailwindV4Engine$1(source) {
|
|
|
1859
1863
|
});
|
|
1860
1864
|
const cached = incrementalGenerateCache$1.get(cacheKey);
|
|
1861
1865
|
if (cached) {
|
|
1866
|
+
if (hasRemovedCandidates$1(cached.seenCandidates, requestedCandidates)) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
1867
|
+
const generated = await generateOnce(source, options);
|
|
1868
|
+
seedIncrementalGenerateCache({
|
|
1869
|
+
compatibleSource,
|
|
1870
|
+
generated,
|
|
1871
|
+
requestedCandidates,
|
|
1872
|
+
styleOptions,
|
|
1873
|
+
tailwindcssV3Compatibility: options.tailwindcssV3Compatibility,
|
|
1874
|
+
target
|
|
1875
|
+
});
|
|
1876
|
+
return generated;
|
|
1877
|
+
});
|
|
1862
1878
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
1863
1879
|
if (missingCandidates.length === 0) return {
|
|
1864
1880
|
css: cached.css,
|
|
@@ -2870,6 +2886,10 @@ function createChangedContentEntries(candidates, sources) {
|
|
|
2870
2886
|
function collectCandidates(candidates) {
|
|
2871
2887
|
return new Set(candidates ?? []);
|
|
2872
2888
|
}
|
|
2889
|
+
function hasRemovedCandidates(previousCandidates, nextCandidates) {
|
|
2890
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
2891
|
+
return false;
|
|
2892
|
+
}
|
|
2873
2893
|
function collectApplyCandidatesFromCss(css) {
|
|
2874
2894
|
if (!css.includes("@apply")) return [];
|
|
2875
2895
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -3174,6 +3194,19 @@ function createTailwindV3Engine(source) {
|
|
|
3174
3194
|
const cacheKey = createIncrementalGenerateCacheKey(source, target, styleOptions);
|
|
3175
3195
|
const cached = incrementalGenerateCache.get(cacheKey);
|
|
3176
3196
|
if (cached) {
|
|
3197
|
+
if (hasRemovedCandidates(cached.seenCandidates, requestedCandidates)) {
|
|
3198
|
+
const generated = await generateOnce(source, options);
|
|
3199
|
+
incrementalGenerateCache.set(cacheKey, {
|
|
3200
|
+
context: generated.context,
|
|
3201
|
+
seenCandidates: new Set(requestedCandidates),
|
|
3202
|
+
classSet: new Set(generated.classSet),
|
|
3203
|
+
css: generated.css,
|
|
3204
|
+
rawCss: generated.rawCss,
|
|
3205
|
+
dependencies: generated.dependencies,
|
|
3206
|
+
target: generated.target
|
|
3207
|
+
});
|
|
3208
|
+
return generated;
|
|
3209
|
+
}
|
|
3177
3210
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
3178
3211
|
if (missingCandidates.length === 0) return {
|
|
3179
3212
|
css: cached.css,
|
|
@@ -1555,6 +1555,10 @@ function applyMiniProgramTailwindV4DefaultColorCss(css) {
|
|
|
1555
1555
|
function collectCandidates$1(candidates) {
|
|
1556
1556
|
return new Set(candidates ?? []);
|
|
1557
1557
|
}
|
|
1558
|
+
function hasRemovedCandidates$1(previousCandidates, nextCandidates) {
|
|
1559
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
1560
|
+
return false;
|
|
1561
|
+
}
|
|
1558
1562
|
function normalizeRpxTextCandidate(candidate) {
|
|
1559
1563
|
return candidate.replace(BARE_RPX_TEXT_CANDIDATE_RE, "$1text-[length:$2]$3");
|
|
1560
1564
|
}
|
|
@@ -1867,6 +1871,18 @@ function createTailwindV4Engine(source) {
|
|
|
1867
1871
|
});
|
|
1868
1872
|
const cached = incrementalGenerateCache$1.get(cacheKey);
|
|
1869
1873
|
if (cached) {
|
|
1874
|
+
if (hasRemovedCandidates$1(cached.seenCandidates, requestedCandidates)) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
1875
|
+
const generated = await generateOnce(source, options);
|
|
1876
|
+
seedIncrementalGenerateCache({
|
|
1877
|
+
compatibleSource,
|
|
1878
|
+
generated,
|
|
1879
|
+
requestedCandidates,
|
|
1880
|
+
styleOptions,
|
|
1881
|
+
tailwindcssV3Compatibility: options.tailwindcssV3Compatibility,
|
|
1882
|
+
target
|
|
1883
|
+
});
|
|
1884
|
+
return generated;
|
|
1885
|
+
});
|
|
1870
1886
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
1871
1887
|
if (missingCandidates.length === 0) return {
|
|
1872
1888
|
css: cached.css,
|
|
@@ -2878,6 +2894,10 @@ function createChangedContentEntries(candidates, sources) {
|
|
|
2878
2894
|
function collectCandidates(candidates) {
|
|
2879
2895
|
return new Set(candidates ?? []);
|
|
2880
2896
|
}
|
|
2897
|
+
function hasRemovedCandidates(previousCandidates, nextCandidates) {
|
|
2898
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
2899
|
+
return false;
|
|
2900
|
+
}
|
|
2881
2901
|
function collectApplyCandidatesFromCss(css) {
|
|
2882
2902
|
if (!css.includes("@apply")) return [];
|
|
2883
2903
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -3182,6 +3202,19 @@ function createTailwindV3Engine(source) {
|
|
|
3182
3202
|
const cacheKey = createIncrementalGenerateCacheKey(source, target, styleOptions);
|
|
3183
3203
|
const cached = incrementalGenerateCache.get(cacheKey);
|
|
3184
3204
|
if (cached) {
|
|
3205
|
+
if (hasRemovedCandidates(cached.seenCandidates, requestedCandidates)) {
|
|
3206
|
+
const generated = await generateOnce(source, options);
|
|
3207
|
+
incrementalGenerateCache.set(cacheKey, {
|
|
3208
|
+
context: generated.context,
|
|
3209
|
+
seenCandidates: new Set(requestedCandidates),
|
|
3210
|
+
classSet: new Set(generated.classSet),
|
|
3211
|
+
css: generated.css,
|
|
3212
|
+
rawCss: generated.rawCss,
|
|
3213
|
+
dependencies: generated.dependencies,
|
|
3214
|
+
target: generated.target
|
|
3215
|
+
});
|
|
3216
|
+
return generated;
|
|
3217
|
+
}
|
|
3185
3218
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
3186
3219
|
if (missingCandidates.length === 0) return {
|
|
3187
3220
|
css: cached.css,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { C as __esmMin, S as __commonJSMin, _ as toCustomAttributesEntities, a as vitePluginName, c as createAttributeMatcher, d as _defineProperty, f as init_defineProperty, h as babelParse, l as analyzeSource, m as replaceWxml, n as getCompilerContext, p as isClassContextLiteralPath, s as generateCode, t as shouldSkipJsTransform, u as JsTokenUpdater, v as collectRuntimeClassSet, w as __require, x as refreshTailwindRuntimeState, y as createTailwindRuntimeReadyPromise } from "./precheck-
|
|
2
|
-
import { B as createDebug, E as filterUnsupportedMiniProgramTailwindV4Candidates, J as findNearestPackageRoot, U as findTailwindConfig, W as resolveTailwindcssOptions, _ as resolveViteSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as createViteSourceScanMatcher, q as omitUndefined, v as resolveViteTailwindV4CssDependencies } from "./v3-engine-
|
|
3
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-
|
|
4
|
-
import { a as validateCandidatesByGenerator, c as hasTailwindRootDirectives,
|
|
1
|
+
import { C as __esmMin, S as __commonJSMin, _ as toCustomAttributesEntities, a as vitePluginName, c as createAttributeMatcher, d as _defineProperty, f as init_defineProperty, h as babelParse, l as analyzeSource, m as replaceWxml, n as getCompilerContext, p as isClassContextLiteralPath, s as generateCode, t as shouldSkipJsTransform, u as JsTokenUpdater, v as collectRuntimeClassSet, w as __require, x as refreshTailwindRuntimeState, y as createTailwindRuntimeReadyPromise } from "./precheck-nPDKYr8V.mjs";
|
|
2
|
+
import { B as createDebug, E as filterUnsupportedMiniProgramTailwindV4Candidates, J as findNearestPackageRoot, U as findTailwindConfig, W as resolveTailwindcssOptions, _ as resolveViteSourceScanEntries, g as resolveTailwindV4EntriesFromCssCached, l as getRuntimeClassSetSignature, m as discoverTailwindV4CssEntries, p as createViteSourceScanMatcher, q as omitUndefined, v as resolveViteTailwindV4CssDependencies } from "./v3-engine-BYcGCWUY.mjs";
|
|
3
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-CmLpVJgw.mjs";
|
|
4
|
+
import { a as validateCandidatesByGenerator, c as hasTailwindRootDirectives, f as hasTailwindGeneratedCssMarkers, i as generateCssByGenerator, l as hasTailwindSourceDirectives, n as createHmrTimingRecorder, o as mergeMarkedUserLayerComponentsCss, s as processCachedTask, t as createBundleRuntimeClassSetManager, u as normalizeTailwindSourceForGenerator } from "./incremental-runtime-class-set-W61zZU00.mjs";
|
|
5
5
|
import { o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
6
|
-
import { c as upsertTailwindV4CssSource, i as resolveUniAppXOptions, r as isUniAppXEnabled, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
7
|
-
import { n as isSourceCandidateRequest, t as createSourceCandidateCollector } from "./source-candidates-
|
|
8
|
-
import { a as createBundleModuleGraphOptions, b as toAbsoluteOutputPath, c as hasBundlerGeneratedCssMarker, d as resolvePluginDisabledState, f as cleanUrl, g as isSourceStyleRequest, h as slash, i as applyLinkedResults, l as stripBundlerGeneratedCssMarkers, m as isCSSRequest, n as createBundleBuildState, o as pushConcurrentTaskFactories, p as formatPostcssSourceMap, r as updateBundleBuildState, s as createBundlerGeneratedCssMarker, t as buildBundleSnapshot, u as resolvePackageDir, v as normalizeOutputPathKey } from "./bundle-state-
|
|
6
|
+
import { c as upsertTailwindV4CssSource, i as resolveUniAppXOptions, r as isUniAppXEnabled, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-D6zEhnyE.mjs";
|
|
7
|
+
import { n as isSourceCandidateRequest, t as createSourceCandidateCollector } from "./source-candidates-l12JBkKU.mjs";
|
|
8
|
+
import { a as createBundleModuleGraphOptions, b as toAbsoluteOutputPath, c as hasBundlerGeneratedCssMarker, d as resolvePluginDisabledState, f as cleanUrl, g as isSourceStyleRequest, h as slash, i as applyLinkedResults, l as stripBundlerGeneratedCssMarkers, m as isCSSRequest, n as createBundleBuildState, o as pushConcurrentTaskFactories, p as formatPostcssSourceMap, r as updateBundleBuildState, s as createBundlerGeneratedCssMarker, t as buildBundleSnapshot, u as resolvePackageDir, v as normalizeOutputPathKey } from "./bundle-state-Bsr05EFW.mjs";
|
|
9
9
|
import { t as logger$1 } from "./logger-BNzxZbZj.mjs";
|
|
10
10
|
import fs, { existsSync, readFileSync } from "node:fs";
|
|
11
11
|
import postcss from "postcss";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
|
+
const require_generator = require("./generator-BtpQoQEH.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-vqTU-eph.js");
|
|
5
|
+
const require_precheck = require("./precheck-Bp-V1T_Q.js");
|
|
6
6
|
const require_utils = require("./utils-D7Ygohep.js");
|
|
7
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
8
|
-
const require_source_candidates = require("./source-candidates-
|
|
9
|
-
const require_bundle_state = require("./bundle-state-
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-bNXguXhC.js");
|
|
8
|
+
const require_source_candidates = require("./source-candidates-BjB4wSga.js");
|
|
9
|
+
const require_bundle_state = require("./bundle-state-8w8DM8Lw.js");
|
|
10
10
|
require("./logger-TlKT3xmR.js");
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
node_fs = require_chunk.__toESM(node_fs);
|
package/dist/vite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_vite = require("./vite-
|
|
2
|
+
const require_vite = require("./vite-CMzi0wR2.js");
|
|
3
3
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
1
|
+
import { t as WeappTailwindcss } from "./vite-C8SUICPv.mjs";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss };
|
|
@@ -1832,6 +1832,10 @@ function applyMiniProgramTailwindV4DefaultColorCss(css) {
|
|
|
1832
1832
|
function collectCandidates$1(candidates) {
|
|
1833
1833
|
return new Set(candidates ?? []);
|
|
1834
1834
|
}
|
|
1835
|
+
function hasRemovedCandidates$1(previousCandidates, nextCandidates) {
|
|
1836
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
1837
|
+
return false;
|
|
1838
|
+
}
|
|
1835
1839
|
function normalizeRpxTextCandidate(candidate) {
|
|
1836
1840
|
return candidate.replace(BARE_RPX_TEXT_CANDIDATE_RE, "$1text-[length:$2]$3");
|
|
1837
1841
|
}
|
|
@@ -2144,6 +2148,18 @@ function createTailwindV4Engine(source) {
|
|
|
2144
2148
|
});
|
|
2145
2149
|
const cached = incrementalGenerateCache$1.get(cacheKey);
|
|
2146
2150
|
if (cached) {
|
|
2151
|
+
if (hasRemovedCandidates$1(cached.seenCandidates, requestedCandidates)) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
2152
|
+
const generated = await generateOnce(source, options);
|
|
2153
|
+
seedIncrementalGenerateCache({
|
|
2154
|
+
compatibleSource,
|
|
2155
|
+
generated,
|
|
2156
|
+
requestedCandidates,
|
|
2157
|
+
styleOptions,
|
|
2158
|
+
tailwindcssV3Compatibility: options.tailwindcssV3Compatibility,
|
|
2159
|
+
target
|
|
2160
|
+
});
|
|
2161
|
+
return generated;
|
|
2162
|
+
});
|
|
2147
2163
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
2148
2164
|
if (missingCandidates.length === 0) return {
|
|
2149
2165
|
css: cached.css,
|
|
@@ -2791,6 +2807,10 @@ function createChangedContentEntries(candidates, sources) {
|
|
|
2791
2807
|
function collectCandidates(candidates) {
|
|
2792
2808
|
return new Set(candidates ?? []);
|
|
2793
2809
|
}
|
|
2810
|
+
function hasRemovedCandidates(previousCandidates, nextCandidates) {
|
|
2811
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
2812
|
+
return false;
|
|
2813
|
+
}
|
|
2794
2814
|
function collectApplyCandidatesFromCss(css) {
|
|
2795
2815
|
if (!css.includes("@apply")) return [];
|
|
2796
2816
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -3095,6 +3115,19 @@ function createTailwindV3Engine(source) {
|
|
|
3095
3115
|
const cacheKey = createIncrementalGenerateCacheKey(source, target, styleOptions);
|
|
3096
3116
|
const cached = incrementalGenerateCache.get(cacheKey);
|
|
3097
3117
|
if (cached) {
|
|
3118
|
+
if (hasRemovedCandidates(cached.seenCandidates, requestedCandidates)) {
|
|
3119
|
+
const generated = await generateOnce(source, options);
|
|
3120
|
+
incrementalGenerateCache.set(cacheKey, {
|
|
3121
|
+
context: generated.context,
|
|
3122
|
+
seenCandidates: new Set(requestedCandidates),
|
|
3123
|
+
classSet: new Set(generated.classSet),
|
|
3124
|
+
css: generated.css,
|
|
3125
|
+
rawCss: generated.rawCss,
|
|
3126
|
+
dependencies: generated.dependencies,
|
|
3127
|
+
target: generated.target
|
|
3128
|
+
});
|
|
3129
|
+
return generated;
|
|
3130
|
+
}
|
|
3098
3131
|
const missingCandidates = [...requestedCandidates].filter((candidate) => !cached.seenCandidates.has(candidate));
|
|
3099
3132
|
if (missingCandidates.length === 0) return {
|
|
3100
3133
|
css: cached.css,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-
|
|
5
|
-
const require_precheck = require("./precheck-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-KDOfD-6F.js");
|
|
3
|
+
const require_generator = require("./generator-BtpQoQEH.js");
|
|
4
|
+
const require_incremental_runtime_class_set = require("./incremental-runtime-class-set-vqTU-eph.js");
|
|
5
|
+
const require_precheck = require("./precheck-Bp-V1T_Q.js");
|
|
6
6
|
const require_utils = require("./utils-D7Ygohep.js");
|
|
7
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
8
|
-
const require_bundle_state = require("./bundle-state-
|
|
7
|
+
const require_tailwindcss = require("./tailwindcss-bNXguXhC.js");
|
|
8
|
+
const require_bundle_state = require("./bundle-state-8w8DM8Lw.js");
|
|
9
9
|
let node_fs = require("node:fs");
|
|
10
10
|
node_fs = require_chunk.__toESM(node_fs);
|
|
11
11
|
let node_module = require("node:module");
|
|
@@ -268,6 +268,10 @@ function createWebpackSnapshotAssets(assets) {
|
|
|
268
268
|
}];
|
|
269
269
|
}));
|
|
270
270
|
}
|
|
271
|
+
function stringifyWebpackSource(source) {
|
|
272
|
+
if (typeof source === "string") return source;
|
|
273
|
+
return source?.toString() ?? "";
|
|
274
|
+
}
|
|
271
275
|
function setupWebpackV5ProcessAssetsHook(options) {
|
|
272
276
|
const { compiler, options: compilerOptions, appType, runtimeState, getRuntimeRefreshRequirement, refreshRuntimeMetadata, isWebpackProcessedCssAsset, consumeRuntimeRefreshRequirement, isWatchMode, runtimeClassSetManager, debug } = options;
|
|
273
277
|
const { Compilation, sources } = compiler.webpack;
|
|
@@ -289,6 +293,22 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
289
293
|
const hmrTimingStartedAt = performance.now();
|
|
290
294
|
for (const chunk of compilation.chunks) if (chunk.id && chunk.hash) compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
291
295
|
const assetHashByChunk = createAssetHashByChunkMap(compilation.chunks);
|
|
296
|
+
const getCurrentAssetSource = (file) => {
|
|
297
|
+
const asset = compilation.getAsset(file);
|
|
298
|
+
if (!asset) return;
|
|
299
|
+
return stringifyWebpackSource(asset.source.source());
|
|
300
|
+
};
|
|
301
|
+
const updateAssetIfChanged = (file, source, { notifyUpdate = true } = {}) => {
|
|
302
|
+
const nextSource = stringifyWebpackSource(source.source());
|
|
303
|
+
const previousSource = getCurrentAssetSource(file);
|
|
304
|
+
if (previousSource === nextSource) {
|
|
305
|
+
debug("asset unchanged, skip update: %s", file);
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
compilation.updateAsset(file, source);
|
|
309
|
+
if (notifyUpdate) compilerOptions.onUpdate(file, previousSource ?? "", nextSource);
|
|
310
|
+
return true;
|
|
311
|
+
};
|
|
292
312
|
const entries = Object.entries(assets);
|
|
293
313
|
const compilerOutputPath = compilation.compiler?.outputPath ?? compiler.outputPath;
|
|
294
314
|
const outputDir = compilerOutputPath ? node_path.default.resolve(compilerOutputPath) : compilation.outputOptions?.path ?? node_process.default.cwd();
|
|
@@ -321,12 +341,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
321
341
|
const asset = compilation.getAsset(assetName);
|
|
322
342
|
if (!asset) continue;
|
|
323
343
|
const previousSource = asset.source.source();
|
|
324
|
-
|
|
325
|
-
if (
|
|
326
|
-
const source = new ConcatSource(code);
|
|
327
|
-
compilation.updateAsset(assetName, source);
|
|
328
|
-
compilerOptions.onUpdate(assetName, previous, code);
|
|
329
|
-
debug("js linked handle: %s", assetName);
|
|
344
|
+
if ((typeof previousSource === "string" ? previousSource : previousSource.toString()) === code) continue;
|
|
345
|
+
if (updateAssetIfChanged(assetName, new ConcatSource(code))) debug("js linked handle: %s", assetName);
|
|
330
346
|
}
|
|
331
347
|
};
|
|
332
348
|
const groupedEntries = require_utils.getGroupedEntries(entries, compilerOptions);
|
|
@@ -355,6 +371,9 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
355
371
|
cssUserHandlerOptionsCache.set(cacheKey, created);
|
|
356
372
|
return created;
|
|
357
373
|
};
|
|
374
|
+
const finalizeCssAssetSource = (source) => {
|
|
375
|
+
return require_incremental_runtime_class_set.removeTailwindSourceDirectives(require_bundle_state.stripBundlerGeneratedCssMarkers(source), { importFallback: true });
|
|
376
|
+
};
|
|
358
377
|
const forceRuntimeRefresh = getRuntimeRefreshRequirement();
|
|
359
378
|
debug("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, runtimeState.twPatcher.majorVersion ?? "unknown");
|
|
360
379
|
let runtimeSet;
|
|
@@ -407,16 +426,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
407
426
|
hashKey: `${file}:asset`,
|
|
408
427
|
rawSource,
|
|
409
428
|
hash: chunkHash,
|
|
410
|
-
applyResult(source) {
|
|
411
|
-
|
|
429
|
+
applyResult(source, { cacheHit }) {
|
|
430
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
412
431
|
},
|
|
413
432
|
onCacheHit() {
|
|
414
433
|
debug("html cache hit: %s", file);
|
|
415
434
|
},
|
|
416
435
|
transform: async () => {
|
|
417
|
-
const
|
|
418
|
-
const source = new ConcatSource(wxml);
|
|
419
|
-
compilerOptions.onUpdate(file, rawSource, wxml);
|
|
436
|
+
const source = new ConcatSource(await compilerOptions.templateHandler(rawSource, defaultTemplateHandlerOptions));
|
|
420
437
|
debug("html handle: %s", file);
|
|
421
438
|
return { result: source };
|
|
422
439
|
}
|
|
@@ -438,8 +455,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
438
455
|
hashKey: `${file}:asset`,
|
|
439
456
|
rawSource: initialRawSource,
|
|
440
457
|
hash: chunkHash,
|
|
441
|
-
applyResult(source) {
|
|
442
|
-
|
|
458
|
+
applyResult(source, { cacheHit }) {
|
|
459
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
443
460
|
},
|
|
444
461
|
onCacheHit() {
|
|
445
462
|
debug("js cache hit: %s", file);
|
|
@@ -459,7 +476,6 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
459
476
|
})) return { result: new ConcatSource(currentSource) };
|
|
460
477
|
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
461
478
|
const source = new ConcatSource(code);
|
|
462
|
-
compilerOptions.onUpdate(file, currentSource, code);
|
|
463
479
|
debug("js handle: %s", file);
|
|
464
480
|
applyLinkedResults(linked);
|
|
465
481
|
return { result: source };
|
|
@@ -471,21 +487,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
471
487
|
const [file, originalSource] = element;
|
|
472
488
|
const rawSource = originalSource.source().toString();
|
|
473
489
|
if (isWebpackProcessedCssAsset?.(file, rawSource)) {
|
|
474
|
-
const nextCss =
|
|
490
|
+
const nextCss = finalizeCssAssetSource(rawSource);
|
|
475
491
|
tasks.push(require_incremental_runtime_class_set.processCachedTask({
|
|
476
492
|
cache: compilerOptions.cache,
|
|
477
493
|
cacheKey: file,
|
|
478
494
|
hashKey: `${file}:asset`,
|
|
479
495
|
rawSource,
|
|
480
496
|
hash: createRuntimeAwareCssHash(assetHashByChunk.get(file), compilerOptions.cache.computeHash(rawSource), runtimeSetHash),
|
|
481
|
-
applyResult(source) {
|
|
482
|
-
|
|
497
|
+
applyResult(source, { cacheHit }) {
|
|
498
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
483
499
|
},
|
|
484
500
|
onCacheHit() {
|
|
485
501
|
debug("css webpack-loader-pipeline cache hit: %s", file);
|
|
486
502
|
},
|
|
487
503
|
transform: async () => {
|
|
488
|
-
compilerOptions.onUpdate(file, rawSource, nextCss);
|
|
489
504
|
debug("css skip webpack-loader-pipeline asset: %s", file);
|
|
490
505
|
return { result: new ConcatSource(nextCss) };
|
|
491
506
|
}
|
|
@@ -500,8 +515,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
500
515
|
hashKey: `${file}:asset`,
|
|
501
516
|
rawSource,
|
|
502
517
|
hash: runtimeAwareHash,
|
|
503
|
-
applyResult(source) {
|
|
504
|
-
|
|
518
|
+
applyResult(source, { cacheHit }) {
|
|
519
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
505
520
|
},
|
|
506
521
|
onCacheHit() {
|
|
507
522
|
debug("css cache hit: %s", file);
|
|
@@ -520,9 +535,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
520
535
|
styleHandler: compilerOptions.styleHandler,
|
|
521
536
|
debug
|
|
522
537
|
});
|
|
523
|
-
const
|
|
524
|
-
const source = new ConcatSource(css);
|
|
525
|
-
compilerOptions.onUpdate(file, rawSource, css);
|
|
538
|
+
const source = new ConcatSource(finalizeCssAssetSource(generated?.css ?? (await compilerOptions.styleHandler(rawSource, cssHandlerOptions)).css));
|
|
526
539
|
if (generated) debug("css handle via tailwind v%s engine(%s): %s", runtimeState.twPatcher.majorVersion, generated.target, file);
|
|
527
540
|
else debug("css handle: %s", file);
|
|
528
541
|
return { result: source };
|
|
@@ -669,6 +682,28 @@ function setupWebpackV5Loaders(options) {
|
|
|
669
682
|
require_precheck.init_defineProperty();
|
|
670
683
|
const debug = require_v3_engine.createDebug();
|
|
671
684
|
const weappTailwindcssPackageDir = require_bundle_state.resolvePackageDir("weapp-tailwindcss");
|
|
685
|
+
function normalizeIgnoredList(ignored) {
|
|
686
|
+
if (Array.isArray(ignored)) return ignored;
|
|
687
|
+
return ignored == null ? [] : [ignored];
|
|
688
|
+
}
|
|
689
|
+
function appendIgnoredPath(ignored, ignoredPath) {
|
|
690
|
+
const ignoredList = normalizeIgnoredList(ignored);
|
|
691
|
+
if (ignoredList.some((item) => typeof item === "string" && node_path.default.resolve(item) === ignoredPath)) return ignored;
|
|
692
|
+
return [...ignoredList, ignoredPath];
|
|
693
|
+
}
|
|
694
|
+
function setupWebpackWatchOutputIgnore(compiler) {
|
|
695
|
+
const originalWatch = compiler.watch?.bind(compiler);
|
|
696
|
+
if (typeof originalWatch !== "function") return;
|
|
697
|
+
compiler.watch = ((watchOptions, handler) => {
|
|
698
|
+
const outputPath = compiler.outputPath || compiler.options?.output?.path;
|
|
699
|
+
const outputDir = outputPath ? node_path.default.resolve(outputPath) : void 0;
|
|
700
|
+
if (!outputDir) return originalWatch(watchOptions, handler);
|
|
701
|
+
return originalWatch({
|
|
702
|
+
...watchOptions,
|
|
703
|
+
ignored: appendIgnoredPath(watchOptions.ignored, outputDir)
|
|
704
|
+
}, handler);
|
|
705
|
+
});
|
|
706
|
+
}
|
|
672
707
|
/**
|
|
673
708
|
* @name WeappTailwindcss
|
|
674
709
|
* @description webpack5 核心转义插件
|
|
@@ -696,6 +731,7 @@ var WeappTailwindcss = class {
|
|
|
696
731
|
const isMpxApp = isMpx(this.appType);
|
|
697
732
|
if (shouldRewriteCssImports) setupMpxTailwindcssRedirect(weappTailwindcssPackageDir, isMpxApp);
|
|
698
733
|
if (disabledOptions.plugin) return;
|
|
734
|
+
setupWebpackWatchOutputIgnore(compiler);
|
|
699
735
|
const runtimeState = {
|
|
700
736
|
twPatcher: initialTwPatcher,
|
|
701
737
|
readyPromise: require_precheck.createTailwindRuntimeReadyPromise(initialTwPatcher),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { b as ensureRuntimeClassSet, d as _defineProperty, f as init_defineProperty, i as pluginName, n as getCompilerContext, t as shouldSkipJsTransform, x as refreshTailwindRuntimeState, y as createTailwindRuntimeReadyPromise } from "./precheck-
|
|
2
|
-
import { B as createDebug, W as resolveTailwindcssOptions, l as getRuntimeClassSetSignature } from "./v3-engine-
|
|
3
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-
|
|
4
|
-
import { i as generateCssByGenerator, r as emitHmrTiming, s as processCachedTask, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-
|
|
1
|
+
import { b as ensureRuntimeClassSet, d as _defineProperty, f as init_defineProperty, i as pluginName, n as getCompilerContext, t as shouldSkipJsTransform, x as refreshTailwindRuntimeState, y as createTailwindRuntimeReadyPromise } from "./precheck-nPDKYr8V.mjs";
|
|
2
|
+
import { B as createDebug, W as resolveTailwindcssOptions, l as getRuntimeClassSetSignature } from "./v3-engine-BYcGCWUY.mjs";
|
|
3
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions } from "./generator-CmLpVJgw.mjs";
|
|
4
|
+
import { d as removeTailwindSourceDirectives, i as generateCssByGenerator, r as emitHmrTiming, s as processCachedTask, t as createBundleRuntimeClassSetManager } from "./incremental-runtime-class-set-W61zZU00.mjs";
|
|
5
5
|
import { r as getGroupedEntries } from "./utils-DsaS975I.mjs";
|
|
6
|
-
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-
|
|
7
|
-
import { _ as stripRequestQuery, b as toAbsoluteOutputPath, d as resolvePluginDisabledState, g as isSourceStyleRequest, l as stripBundlerGeneratedCssMarkers, n as createBundleBuildState, o as pushConcurrentTaskFactories, r as updateBundleBuildState, t as buildBundleSnapshot, u as resolvePackageDir, y as resolveOutputSpecifier } from "./bundle-state-
|
|
6
|
+
import { c as upsertTailwindV4CssSource, s as hasConfiguredTailwindV4CssRoots } from "./tailwindcss-D6zEhnyE.mjs";
|
|
7
|
+
import { _ as stripRequestQuery, b as toAbsoluteOutputPath, d as resolvePluginDisabledState, g as isSourceStyleRequest, l as stripBundlerGeneratedCssMarkers, n as createBundleBuildState, o as pushConcurrentTaskFactories, r as updateBundleBuildState, t as buildBundleSnapshot, u as resolvePackageDir, y as resolveOutputSpecifier } from "./bundle-state-Bsr05EFW.mjs";
|
|
8
8
|
import Module, { createRequire } from "node:module";
|
|
9
9
|
import fs from "node:fs";
|
|
10
10
|
import process from "node:process";
|
|
@@ -264,6 +264,10 @@ function createWebpackSnapshotAssets(assets) {
|
|
|
264
264
|
}];
|
|
265
265
|
}));
|
|
266
266
|
}
|
|
267
|
+
function stringifyWebpackSource(source) {
|
|
268
|
+
if (typeof source === "string") return source;
|
|
269
|
+
return source?.toString() ?? "";
|
|
270
|
+
}
|
|
267
271
|
function setupWebpackV5ProcessAssetsHook(options) {
|
|
268
272
|
const { compiler, options: compilerOptions, appType, runtimeState, getRuntimeRefreshRequirement, refreshRuntimeMetadata, isWebpackProcessedCssAsset, consumeRuntimeRefreshRequirement, isWatchMode, runtimeClassSetManager, debug } = options;
|
|
269
273
|
const { Compilation, sources } = compiler.webpack;
|
|
@@ -285,6 +289,22 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
285
289
|
const hmrTimingStartedAt = performance.now();
|
|
286
290
|
for (const chunk of compilation.chunks) if (chunk.id && chunk.hash) compilerOptions.cache.calcHashValueChanged(chunk.id, chunk.hash);
|
|
287
291
|
const assetHashByChunk = createAssetHashByChunkMap(compilation.chunks);
|
|
292
|
+
const getCurrentAssetSource = (file) => {
|
|
293
|
+
const asset = compilation.getAsset(file);
|
|
294
|
+
if (!asset) return;
|
|
295
|
+
return stringifyWebpackSource(asset.source.source());
|
|
296
|
+
};
|
|
297
|
+
const updateAssetIfChanged = (file, source, { notifyUpdate = true } = {}) => {
|
|
298
|
+
const nextSource = stringifyWebpackSource(source.source());
|
|
299
|
+
const previousSource = getCurrentAssetSource(file);
|
|
300
|
+
if (previousSource === nextSource) {
|
|
301
|
+
debug("asset unchanged, skip update: %s", file);
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
compilation.updateAsset(file, source);
|
|
305
|
+
if (notifyUpdate) compilerOptions.onUpdate(file, previousSource ?? "", nextSource);
|
|
306
|
+
return true;
|
|
307
|
+
};
|
|
288
308
|
const entries = Object.entries(assets);
|
|
289
309
|
const compilerOutputPath = compilation.compiler?.outputPath ?? compiler.outputPath;
|
|
290
310
|
const outputDir = compilerOutputPath ? path.resolve(compilerOutputPath) : compilation.outputOptions?.path ?? process.cwd();
|
|
@@ -317,12 +337,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
317
337
|
const asset = compilation.getAsset(assetName);
|
|
318
338
|
if (!asset) continue;
|
|
319
339
|
const previousSource = asset.source.source();
|
|
320
|
-
|
|
321
|
-
if (
|
|
322
|
-
const source = new ConcatSource(code);
|
|
323
|
-
compilation.updateAsset(assetName, source);
|
|
324
|
-
compilerOptions.onUpdate(assetName, previous, code);
|
|
325
|
-
debug("js linked handle: %s", assetName);
|
|
340
|
+
if ((typeof previousSource === "string" ? previousSource : previousSource.toString()) === code) continue;
|
|
341
|
+
if (updateAssetIfChanged(assetName, new ConcatSource(code))) debug("js linked handle: %s", assetName);
|
|
326
342
|
}
|
|
327
343
|
};
|
|
328
344
|
const groupedEntries = getGroupedEntries(entries, compilerOptions);
|
|
@@ -351,6 +367,9 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
351
367
|
cssUserHandlerOptionsCache.set(cacheKey, created);
|
|
352
368
|
return created;
|
|
353
369
|
};
|
|
370
|
+
const finalizeCssAssetSource = (source) => {
|
|
371
|
+
return removeTailwindSourceDirectives(stripBundlerGeneratedCssMarkers(source), { importFallback: true });
|
|
372
|
+
};
|
|
354
373
|
const forceRuntimeRefresh = getRuntimeRefreshRequirement();
|
|
355
374
|
debug("processAssets ensure runtime set forceRefresh=%s major=%s", forceRuntimeRefresh, runtimeState.twPatcher.majorVersion ?? "unknown");
|
|
356
375
|
let runtimeSet;
|
|
@@ -403,16 +422,14 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
403
422
|
hashKey: `${file}:asset`,
|
|
404
423
|
rawSource,
|
|
405
424
|
hash: chunkHash,
|
|
406
|
-
applyResult(source) {
|
|
407
|
-
|
|
425
|
+
applyResult(source, { cacheHit }) {
|
|
426
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
408
427
|
},
|
|
409
428
|
onCacheHit() {
|
|
410
429
|
debug("html cache hit: %s", file);
|
|
411
430
|
},
|
|
412
431
|
transform: async () => {
|
|
413
|
-
const
|
|
414
|
-
const source = new ConcatSource(wxml);
|
|
415
|
-
compilerOptions.onUpdate(file, rawSource, wxml);
|
|
432
|
+
const source = new ConcatSource(await compilerOptions.templateHandler(rawSource, defaultTemplateHandlerOptions));
|
|
416
433
|
debug("html handle: %s", file);
|
|
417
434
|
return { result: source };
|
|
418
435
|
}
|
|
@@ -434,8 +451,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
434
451
|
hashKey: `${file}:asset`,
|
|
435
452
|
rawSource: initialRawSource,
|
|
436
453
|
hash: chunkHash,
|
|
437
|
-
applyResult(source) {
|
|
438
|
-
|
|
454
|
+
applyResult(source, { cacheHit }) {
|
|
455
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
439
456
|
},
|
|
440
457
|
onCacheHit() {
|
|
441
458
|
debug("js cache hit: %s", file);
|
|
@@ -455,7 +472,6 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
455
472
|
})) return { result: new ConcatSource(currentSource) };
|
|
456
473
|
const { code, linked } = await compilerOptions.jsHandler(currentSource, runtimeSet, handlerOptions);
|
|
457
474
|
const source = new ConcatSource(code);
|
|
458
|
-
compilerOptions.onUpdate(file, currentSource, code);
|
|
459
475
|
debug("js handle: %s", file);
|
|
460
476
|
applyLinkedResults(linked);
|
|
461
477
|
return { result: source };
|
|
@@ -467,21 +483,20 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
467
483
|
const [file, originalSource] = element;
|
|
468
484
|
const rawSource = originalSource.source().toString();
|
|
469
485
|
if (isWebpackProcessedCssAsset?.(file, rawSource)) {
|
|
470
|
-
const nextCss =
|
|
486
|
+
const nextCss = finalizeCssAssetSource(rawSource);
|
|
471
487
|
tasks.push(processCachedTask({
|
|
472
488
|
cache: compilerOptions.cache,
|
|
473
489
|
cacheKey: file,
|
|
474
490
|
hashKey: `${file}:asset`,
|
|
475
491
|
rawSource,
|
|
476
492
|
hash: createRuntimeAwareCssHash(assetHashByChunk.get(file), compilerOptions.cache.computeHash(rawSource), runtimeSetHash),
|
|
477
|
-
applyResult(source) {
|
|
478
|
-
|
|
493
|
+
applyResult(source, { cacheHit }) {
|
|
494
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
479
495
|
},
|
|
480
496
|
onCacheHit() {
|
|
481
497
|
debug("css webpack-loader-pipeline cache hit: %s", file);
|
|
482
498
|
},
|
|
483
499
|
transform: async () => {
|
|
484
|
-
compilerOptions.onUpdate(file, rawSource, nextCss);
|
|
485
500
|
debug("css skip webpack-loader-pipeline asset: %s", file);
|
|
486
501
|
return { result: new ConcatSource(nextCss) };
|
|
487
502
|
}
|
|
@@ -496,8 +511,8 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
496
511
|
hashKey: `${file}:asset`,
|
|
497
512
|
rawSource,
|
|
498
513
|
hash: runtimeAwareHash,
|
|
499
|
-
applyResult(source) {
|
|
500
|
-
|
|
514
|
+
applyResult(source, { cacheHit }) {
|
|
515
|
+
updateAssetIfChanged(file, source, { notifyUpdate: !cacheHit });
|
|
501
516
|
},
|
|
502
517
|
onCacheHit() {
|
|
503
518
|
debug("css cache hit: %s", file);
|
|
@@ -516,9 +531,7 @@ function setupWebpackV5ProcessAssetsHook(options) {
|
|
|
516
531
|
styleHandler: compilerOptions.styleHandler,
|
|
517
532
|
debug
|
|
518
533
|
});
|
|
519
|
-
const
|
|
520
|
-
const source = new ConcatSource(css);
|
|
521
|
-
compilerOptions.onUpdate(file, rawSource, css);
|
|
534
|
+
const source = new ConcatSource(finalizeCssAssetSource(generated?.css ?? (await compilerOptions.styleHandler(rawSource, cssHandlerOptions)).css));
|
|
522
535
|
if (generated) debug("css handle via tailwind v%s engine(%s): %s", runtimeState.twPatcher.majorVersion, generated.target, file);
|
|
523
536
|
else debug("css handle: %s", file);
|
|
524
537
|
return { result: source };
|
|
@@ -670,6 +683,28 @@ function setupWebpackV5Loaders(options) {
|
|
|
670
683
|
init_defineProperty();
|
|
671
684
|
const debug = createDebug();
|
|
672
685
|
const weappTailwindcssPackageDir = resolvePackageDir("weapp-tailwindcss");
|
|
686
|
+
function normalizeIgnoredList(ignored) {
|
|
687
|
+
if (Array.isArray(ignored)) return ignored;
|
|
688
|
+
return ignored == null ? [] : [ignored];
|
|
689
|
+
}
|
|
690
|
+
function appendIgnoredPath(ignored, ignoredPath) {
|
|
691
|
+
const ignoredList = normalizeIgnoredList(ignored);
|
|
692
|
+
if (ignoredList.some((item) => typeof item === "string" && path.resolve(item) === ignoredPath)) return ignored;
|
|
693
|
+
return [...ignoredList, ignoredPath];
|
|
694
|
+
}
|
|
695
|
+
function setupWebpackWatchOutputIgnore(compiler) {
|
|
696
|
+
const originalWatch = compiler.watch?.bind(compiler);
|
|
697
|
+
if (typeof originalWatch !== "function") return;
|
|
698
|
+
compiler.watch = ((watchOptions, handler) => {
|
|
699
|
+
const outputPath = compiler.outputPath || compiler.options?.output?.path;
|
|
700
|
+
const outputDir = outputPath ? path.resolve(outputPath) : void 0;
|
|
701
|
+
if (!outputDir) return originalWatch(watchOptions, handler);
|
|
702
|
+
return originalWatch({
|
|
703
|
+
...watchOptions,
|
|
704
|
+
ignored: appendIgnoredPath(watchOptions.ignored, outputDir)
|
|
705
|
+
}, handler);
|
|
706
|
+
});
|
|
707
|
+
}
|
|
673
708
|
/**
|
|
674
709
|
* @name WeappTailwindcss
|
|
675
710
|
* @description webpack5 核心转义插件
|
|
@@ -697,6 +732,7 @@ var WeappTailwindcss = class {
|
|
|
697
732
|
const isMpxApp = isMpx(this.appType);
|
|
698
733
|
if (shouldRewriteCssImports) setupMpxTailwindcssRedirect(weappTailwindcssPackageDir, isMpxApp);
|
|
699
734
|
if (disabledOptions.plugin) return;
|
|
735
|
+
setupWebpackWatchOutputIgnore(compiler);
|
|
700
736
|
const runtimeState = {
|
|
701
737
|
twPatcher: initialTwPatcher,
|
|
702
738
|
readyPromise: createTailwindRuntimeReadyPromise(initialTwPatcher),
|
package/dist/webpack.js
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-2v1sQKyZ.js");
|
|
3
3
|
exports.WeappTailwindcss = require_webpack.WeappTailwindcss;
|
|
4
4
|
exports.weappTailwindcss = require_webpack.WeappTailwindcss;
|
|
5
5
|
exports.weappTailwindcssPackageDir = require_webpack.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
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-pdpdIv_X.mjs";
|
|
2
2
|
export { WeappTailwindcss, WeappTailwindcss as weappTailwindcss, weappTailwindcssPackageDir };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.35",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -185,10 +185,10 @@
|
|
|
185
185
|
"tailwindcss-patch": "9.4.1",
|
|
186
186
|
"yaml": "^2.9.0",
|
|
187
187
|
"@weapp-tailwindcss/logger": "2.0.0-next.0",
|
|
188
|
-
"@weapp-tailwindcss/postcss": "3.0.0-next.9",
|
|
189
|
-
"@weapp-tailwindcss/reset": "0.1.1-next.1",
|
|
190
188
|
"@weapp-tailwindcss/shared": "2.0.0-next.1",
|
|
191
|
-
"tailwindcss-config": "2.0.0-next.3"
|
|
189
|
+
"tailwindcss-config": "2.0.0-next.3",
|
|
190
|
+
"@weapp-tailwindcss/postcss": "3.0.0-next.9",
|
|
191
|
+
"@weapp-tailwindcss/reset": "0.1.1-next.1"
|
|
192
192
|
},
|
|
193
193
|
"devDependencies": {
|
|
194
194
|
"@vue/compiler-dom": "^3.5.35",
|