weapp-tailwindcss 5.1.13 → 5.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-2dg_uhEJ.mjs +13 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +2 -0
- package/dist/bundlers/gulp/index.d.ts +2 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +2 -0
- package/dist/bundlers/shared/generated-css-marker.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/types.d.ts +5 -0
- package/dist/bundlers/shared/style-requests.d.ts +1 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -0
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +2 -0
- package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +18 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +7 -0
- package/dist/bundlers/vite/serve-css-generation.d.ts +3 -2
- package/dist/bundlers/vite/serve-root-import-shell.d.ts +8 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +1 -0
- package/dist/bundlers/vite/source-candidates.d.ts +3 -0
- package/dist/bundlers/vite/watch-css-post.d.ts +10 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +2 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +4 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +3 -0
- package/dist/{context-xSJE588m.mjs → context-BgGWVAmN.mjs} +5 -3
- package/dist/{context-DRRgW7i2.js → context-VeFq_8vW.js} +5 -3
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{generator-CS10c9g1.js → generator-CEnUsjed.js} +17 -3
- package/dist/{generator-BvPcmqxU.mjs → generator-CEo920So.mjs} +18 -4
- package/dist/generator.js +1 -1
- package/dist/generator.mjs +1 -1
- package/dist/{gulp-DNZZvUMq.js → gulp-3m1dAiig.js} +92 -54
- package/dist/{gulp-BEOzXrbp.mjs → gulp-DP71z1jG.mjs} +92 -54
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-hRhRAjYV.mjs → hmr-timing-1aS6--U7.mjs} +272 -56
- package/dist/{hmr-timing-DW1g3zjl.js → hmr-timing-B8p4f0ca.js} +323 -53
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/shared/mpx.d.ts +4 -1
- package/dist/{source-candidate-scan-signature-CMgu5bJk.js → source-candidate-scan-signature-BAahhiwb.js} +20 -139
- package/dist/{source-candidate-scan-signature-t4XKAQ04.mjs → source-candidate-scan-signature-Cf7259PR.mjs} +21 -104
- package/dist/tailwindcss/candidates.d.ts +4 -0
- package/dist/{tailwindcss-z9JMF-qU.js → tailwindcss-KBYPJ2DW.js} +1 -1
- package/dist/{tailwindcss-DZT_pWrd.mjs → tailwindcss-xs704TRw.mjs} +1 -1
- package/dist/{transform-D5JUgMpE.mjs → transform-B_KM9sLX.mjs} +47 -5
- package/dist/{transform-COFRlmDF.js → transform-CcYptivi.js} +47 -5
- package/dist/uni-app-x/component-local-style.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +1 -1
- package/dist/{vite-DnkObu2L.js → vite-DUVjMduj.js} +807 -320
- package/dist/{vite-Tpgi77vE.mjs → vite-nXZEiwG0.mjs} +757 -270
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-generation-loader.js +12 -0
- package/dist/weapp-tw-css-import-rewrite-loader-DNk0IxAt.js +10198 -0
- package/dist/weapp-tw-css-import-rewrite-loader.js +6 -8209
- package/dist/{webpack-CTYm19zA.mjs → webpack-C_UUFRgj.mjs} +228 -58
- package/dist/{webpack-CzXjfvYS.js → webpack-nppysF4B.js} +240 -70
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +11 -3
- package/dist/auto-CrJJc5rK.mjs +0 -13
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-CEnUsjed.js");
|
|
3
|
+
require("./auto-DtU6f3X6.js");
|
|
3
4
|
const require_object = require("./object-COs_Mw6p.js");
|
|
4
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-KBYPJ2DW.js");
|
|
5
6
|
const require_wxml = require("./wxml-Ce10eREX.js");
|
|
6
|
-
const require_context = require("./context-
|
|
7
|
+
const require_context = require("./context-VeFq_8vW.js");
|
|
7
8
|
let node_fs = require("node:fs");
|
|
8
9
|
let node_path = require("node:path");
|
|
9
10
|
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
@@ -133,6 +134,39 @@ function annotateCssSourceTrace(css, options) {
|
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
//#endregion
|
|
137
|
+
//#region src/bundlers/shared/generated-css-marker.ts
|
|
138
|
+
const BUNDLER_GENERATED_CSS_MARKER_RE = /\/\*!?\s*weapp-tailwindcss (?:gulp|vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/i;
|
|
139
|
+
const BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE = /\/\*!?\s*weapp-tailwindcss (?:gulp|vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/gi;
|
|
140
|
+
const BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE = /\/\*!?\s*weapp-tailwindcss (gulp|vite|webpack)-generated-css(?:\s*:\s*([^\s*]+))?\s*\*\/\s*/gi;
|
|
141
|
+
const VITE_INTERNAL_CSS_MARKER_GLOBAL_RE = /\/\*\$vite\$:\d+\*\/\s*/g;
|
|
142
|
+
function createBundlerGeneratedCssMarker(bundler, file) {
|
|
143
|
+
return `/*! weapp-tailwindcss ${bundler}-generated-css:${encodeURIComponent(file)} */`;
|
|
144
|
+
}
|
|
145
|
+
function hasBundlerGeneratedCssMarker(source) {
|
|
146
|
+
return typeof source === "string" && BUNDLER_GENERATED_CSS_MARKER_RE.test(source);
|
|
147
|
+
}
|
|
148
|
+
function stripBundlerGeneratedCssMarkers(source) {
|
|
149
|
+
return source.replace(BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE, "").replace(VITE_INTERNAL_CSS_MARKER_GLOBAL_RE, "");
|
|
150
|
+
}
|
|
151
|
+
function parseBundlerGeneratedCssMarkerBlocks(source) {
|
|
152
|
+
const blocks = [];
|
|
153
|
+
BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE.lastIndex = 0;
|
|
154
|
+
let match = BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE.exec(source);
|
|
155
|
+
while (match !== null) {
|
|
156
|
+
const cssStart = BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE.lastIndex;
|
|
157
|
+
const nextMatch = BUNDLER_GENERATED_CSS_MARKER_CAPTURE_RE.exec(source);
|
|
158
|
+
const cssEnd = nextMatch?.index ?? source.length;
|
|
159
|
+
const file = match[2] ? decodeURIComponent(match[2]) : void 0;
|
|
160
|
+
blocks.push({
|
|
161
|
+
bundler: match[1],
|
|
162
|
+
file,
|
|
163
|
+
css: source.slice(cssStart, cssEnd)
|
|
164
|
+
});
|
|
165
|
+
match = nextMatch;
|
|
166
|
+
}
|
|
167
|
+
return blocks;
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
136
170
|
//#region src/bundlers/shared/generator-css/class-selectors.ts
|
|
137
171
|
function normalizeCssClassSelector(value) {
|
|
138
172
|
return value.replace(/\\([^\da-f\r\n])/gi, "$1").replace(/\\([\da-f]{1,6})\s?/gi, (_, code) => String.fromCodePoint(Number.parseInt(code, 16)));
|
|
@@ -157,11 +191,47 @@ function collectGeneratedRawSourceCandidates(candidates, rawSource, escapeMap) {
|
|
|
157
191
|
return matched;
|
|
158
192
|
}
|
|
159
193
|
//#endregion
|
|
194
|
+
//#region src/bundlers/shared/style-requests.ts
|
|
195
|
+
const SOURCE_STYLE_EXT_RE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)$/i;
|
|
196
|
+
const STYLE_QUERY_RE = /(?:^|&)type=styles?(?:&|$)/;
|
|
197
|
+
const VUE_STYLE_QUERY_RE = /(?:^|&)type=style(?:&|$)/;
|
|
198
|
+
const STYLE_LANG_QUERY_RE = /(?:^|&)lang(?:[.=](?:css|scss|sass|less|styl|stylus|pcss|postcss))?(?:&|$)/;
|
|
199
|
+
function stripHash(request) {
|
|
200
|
+
const hashIndex = request.indexOf("#");
|
|
201
|
+
return hashIndex === -1 ? request : request.slice(0, hashIndex);
|
|
202
|
+
}
|
|
203
|
+
function stripRequestQuery(request) {
|
|
204
|
+
const normalized = stripHash(request);
|
|
205
|
+
const queryIndex = normalized.indexOf("?");
|
|
206
|
+
return queryIndex === -1 ? normalized : normalized.slice(0, queryIndex);
|
|
207
|
+
}
|
|
208
|
+
function isSourceStyleRequest(request) {
|
|
209
|
+
if (typeof request !== "string" || request.length === 0) return false;
|
|
210
|
+
const normalized = stripHash(request);
|
|
211
|
+
const queryIndex = normalized.indexOf("?");
|
|
212
|
+
const pathname = queryIndex === -1 ? normalized : normalized.slice(0, queryIndex);
|
|
213
|
+
if (SOURCE_STYLE_EXT_RE.test(pathname)) return true;
|
|
214
|
+
if (queryIndex === -1) return false;
|
|
215
|
+
const query = normalized.slice(queryIndex + 1);
|
|
216
|
+
return STYLE_QUERY_RE.test(query) || STYLE_LANG_QUERY_RE.test(query);
|
|
217
|
+
}
|
|
218
|
+
function isVueScopedStyleRequest(request) {
|
|
219
|
+
if (typeof request !== "string" || request.length === 0) return false;
|
|
220
|
+
const normalized = stripHash(request);
|
|
221
|
+
const queryIndex = normalized.indexOf("?");
|
|
222
|
+
if (queryIndex === -1) return false;
|
|
223
|
+
const query = normalized.slice(queryIndex + 1);
|
|
224
|
+
return VUE_STYLE_QUERY_RE.test(query) && /(?:^|&)scoped(?:=[^&]*)?(?:&|$)/.test(query);
|
|
225
|
+
}
|
|
226
|
+
//#endregion
|
|
160
227
|
//#region src/bundlers/shared/generator-css/source-resolver/postcss-source.ts
|
|
161
228
|
function resolvePostcssFromOption(cssHandlerOptions) {
|
|
162
229
|
const from = cssHandlerOptions.postcssOptions?.options?.from;
|
|
163
230
|
return typeof from === "string" && from.length > 0 ? from : void 0;
|
|
164
231
|
}
|
|
232
|
+
function resolvePostcssRequestOption(cssHandlerOptions) {
|
|
233
|
+
return resolveCssHandlerSourceOptions(cssHandlerOptions)?.requestFile ?? resolvePostcssFromOption(cssHandlerOptions);
|
|
234
|
+
}
|
|
165
235
|
function resolvePostcssSourceFile(cssHandlerOptions) {
|
|
166
236
|
const from = resolvePostcssFromOption(cssHandlerOptions);
|
|
167
237
|
if (!from || !node_path.default.isAbsolute(from)) return;
|
|
@@ -176,13 +246,6 @@ function resolveCssSourceBase(file, cssHandlerOptions) {
|
|
|
176
246
|
}
|
|
177
247
|
//#endregion
|
|
178
248
|
//#region src/bundlers/shared/generator-css/generation-helpers.ts
|
|
179
|
-
function isVueScopedStyleSource(from) {
|
|
180
|
-
if (typeof from !== "string" || from.length === 0) return false;
|
|
181
|
-
const queryIndex = from.indexOf("?");
|
|
182
|
-
if (queryIndex === -1) return false;
|
|
183
|
-
const query = from.slice(queryIndex + 1);
|
|
184
|
-
return /(?:^|&)type=style(?:&|$)/.test(query) && /(?:^|&)scoped(?:=[^&]*)?(?:&|$)/.test(query);
|
|
185
|
-
}
|
|
186
249
|
function hasMiniProgramTailwindV4PreflightReset(css) {
|
|
187
250
|
return /(?:^|[},])\s*view\s*,\s*text\s*,\s*::after\s*,\s*::before\s*\{[^}]*\bborder\s*:\s*0\s+solid\b/.test(css);
|
|
188
251
|
}
|
|
@@ -191,7 +254,7 @@ function isMiniProgramGeneratorTarget(target) {
|
|
|
191
254
|
}
|
|
192
255
|
function finalizeMiniProgramGeneratorCss(css, target, _majorVersion, cssPreflight, options = {}) {
|
|
193
256
|
if (!isMiniProgramGeneratorTarget(target)) return css;
|
|
194
|
-
if (
|
|
257
|
+
if (options.styleOptions && isVueScopedStyleRequest(resolvePostcssRequestOption(options.styleOptions))) return (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCss)(css, {
|
|
195
258
|
cssPreflight: false,
|
|
196
259
|
cssSelectorReplacement: options.styleOptions?.cssOptions?.cssSelectorReplacement ?? options.styleOptions?.cssSelectorReplacement,
|
|
197
260
|
isTailwindcssV4: true,
|
|
@@ -208,7 +271,7 @@ function finalizeMiniProgramGeneratorCss(css, target, _majorVersion, cssPrefligh
|
|
|
208
271
|
});
|
|
209
272
|
}
|
|
210
273
|
function resolveMiniProgramPreflightModeForGeneratorCss(opts, options) {
|
|
211
|
-
if (
|
|
274
|
+
if (isVueScopedStyleRequest(resolvePostcssRequestOption(options.cssHandlerOptions))) return {
|
|
212
275
|
inject: false,
|
|
213
276
|
preserve: false
|
|
214
277
|
};
|
|
@@ -278,7 +341,7 @@ function isEmptyCssSourceOrderParts(parts) {
|
|
|
278
341
|
}
|
|
279
342
|
function resolveGeneratorStyleOptions(opts, cssHandlerOptions, generatorStyleOptions) {
|
|
280
343
|
const resolvedStyleOptions = require_context.resolveStyleOptionsFromContext(opts);
|
|
281
|
-
const scopedVueStyleSource =
|
|
344
|
+
const scopedVueStyleSource = isVueScopedStyleRequest(resolvePostcssRequestOption(cssHandlerOptions));
|
|
282
345
|
const preflightStyleOptions = {
|
|
283
346
|
cssPreflight: scopedVueStyleSource ? false : resolvedStyleOptions.cssPreflight,
|
|
284
347
|
cssPreflightRange: scopedVueStyleSource ? void 0 : resolvedStyleOptions.cssPreflightRange
|
|
@@ -1476,7 +1539,8 @@ async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, fi
|
|
|
1476
1539
|
index: 0,
|
|
1477
1540
|
matched: true
|
|
1478
1541
|
}) : void 0;
|
|
1479
|
-
const
|
|
1542
|
+
const canResolveCombinedConfiguredCssSources = (normalizedSourceOptions?.cssSources?.length ?? 0) <= 1 || require_generator.hasTailwindGeneratedCss(rawSource);
|
|
1543
|
+
const configuredCssSource = normalizedSourceOptions && hasConfiguredTailwindV4CssSource(normalizedSourceOptions) && require_generator.hasTailwindGeneratedCssMarkers(rawSource) ? matchedCssSource ?? candidateMatchedCssSource ?? singleConfiguredCssSource ?? (canResolveCombinedConfiguredCssSources ? await require_generator.resolveTailwindV4Source(normalizedSourceOptions) : void 0) : void 0;
|
|
1480
1544
|
if (configuredCssSource) return generatorOptions?.config ? {
|
|
1481
1545
|
...configuredCssSource,
|
|
1482
1546
|
css: require_generator.prependConfigDirective(configuredCssSource.css, generatorOptions.config)
|
|
@@ -2318,10 +2382,14 @@ async function generateCssByGenerator(options) {
|
|
|
2318
2382
|
const configuredContainerCompat = hasConfiguredContainerCompatSources(generatorSources);
|
|
2319
2383
|
const sourceConcurrency = resolveGeneratorSourceConcurrency();
|
|
2320
2384
|
const generated = mergeGeneratorResults((await runWithConcurrency(generatorSources.map((source) => async () => {
|
|
2385
|
+
const sourceCss = options.deferCssAdaptation ? (0, _weapp_tailwindcss_postcss.removeMatchingLocalCssImports)(source.css, localImports) : source.css;
|
|
2321
2386
|
const generator = require_generator.createWeappTailwindcssGenerator(options.disableSourceScan === true ? {
|
|
2322
2387
|
...source,
|
|
2323
|
-
css: require_generator.removeTailwindSourceDirectives(
|
|
2324
|
-
} : source
|
|
2388
|
+
css: require_generator.removeTailwindSourceDirectives(sourceCss, { importFallback: generatorOptions.importFallback })
|
|
2389
|
+
} : sourceCss === source.css ? source : {
|
|
2390
|
+
...source,
|
|
2391
|
+
css: sourceCss
|
|
2392
|
+
});
|
|
2325
2393
|
const sourceEntries = getSourceCandidatesForEntries ? await resolveGeneratorSourceEntries(source, runtimeState) : void 0;
|
|
2326
2394
|
const sourceScopedRuntime = sourceEntries && sourceEntries.length > 0 ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
2327
2395
|
const scopedRuntime = resolveScopedRuntimeCandidates(options.sourceCandidates, sourceScopedRuntime);
|
|
@@ -2354,6 +2422,91 @@ async function generateCssByGenerator(options) {
|
|
|
2354
2422
|
}), sourceConcurrency)).filter((item) => Boolean(item)));
|
|
2355
2423
|
if (!generated) return;
|
|
2356
2424
|
debug("tailwind generator result: %s rawBytes=%d cssBytes=%d candidates=%d", file, generated.rawCss.length, generated.css.length, generated.classSet.size);
|
|
2425
|
+
const hasMatchedCssSourceFile = generatorSources.some((source) => source.__weappTailwindcssMeta?.matchedCssSourceFile);
|
|
2426
|
+
const hasExplicitCssSource = generatorSources.some((source) => {
|
|
2427
|
+
const metadata = source.__weappTailwindcssMeta;
|
|
2428
|
+
return metadata?.candidateMatchedCssSource !== true && (metadata?.cssEntryIndex !== void 0 || metadata?.cssSourceIndex !== void 0);
|
|
2429
|
+
});
|
|
2430
|
+
const hasPreflightCssSource = generatorSources.some((source) => {
|
|
2431
|
+
const metadata = source.__weappTailwindcssMeta;
|
|
2432
|
+
const appEntryMatchedByCandidates = metadata?.candidateMatchedCssSource === true && metadata.cssEntryIndex === 0 && metadata.cssSourceIndex === void 0;
|
|
2433
|
+
return metadata?.includesPreflight === true && !appEntryMatchedByCandidates;
|
|
2434
|
+
});
|
|
2435
|
+
const hasPreflightRawSource = require_tailwindcss.includesTailwindV4PreflightDirective(generatorRawSource);
|
|
2436
|
+
const hasOnlyPrimaryCssSource = generatorSources.length > 0 && generatorSources.every((source) => {
|
|
2437
|
+
const metadata = source.__weappTailwindcssMeta;
|
|
2438
|
+
return metadata?.candidateMatchedCssSource !== true && metadata?.primaryCssSource === true;
|
|
2439
|
+
});
|
|
2440
|
+
const shouldFilterApplyOnlyCss = require_generator.shouldFilterApplyOnlyGeneratedCss(majorVersion, generated.target, generatorRawSource, {
|
|
2441
|
+
hasGeneratedCss,
|
|
2442
|
+
hasGeneratedMarkers
|
|
2443
|
+
});
|
|
2444
|
+
const filterGeneratedApplyOnlyCss = (css) => {
|
|
2445
|
+
if (!shouldFilterApplyOnlyCss) return css;
|
|
2446
|
+
return require_generator.filterApplyOnlyGeneratedCss(css, generatorRawSource, { preserveVariables: generated.target !== "web" });
|
|
2447
|
+
};
|
|
2448
|
+
const preflightMode = resolveMiniProgramPreflightModeForGeneratorCss(opts, {
|
|
2449
|
+
cssHandlerOptions,
|
|
2450
|
+
isolateCurrentCssCandidates,
|
|
2451
|
+
localImports,
|
|
2452
|
+
explicitCssSource: hasExplicitCssSource,
|
|
2453
|
+
primaryCssSource: hasOnlyPrimaryCssSource || hasPreflightCssSource || hasPreflightRawSource
|
|
2454
|
+
});
|
|
2455
|
+
if (options.deferCssAdaptation) {
|
|
2456
|
+
const normalizeDeferredGeneratedCss = async (css) => {
|
|
2457
|
+
const rawCss = require_generator.stripTailwindBanner(css);
|
|
2458
|
+
const generationCss = generated.target === "weapp" && ((0, _weapp_tailwindcss_postcss.hasCssMacroStyleOptions)(generatorStyleOptions) || (0, _weapp_tailwindcss_postcss.hasCssMacroTailwindV4InternalAtRules)(rawCss)) ? await (0, _weapp_tailwindcss_postcss.transformCssMacroCss)(rawCss, generatorStyleOptions) : rawCss;
|
|
2459
|
+
const normalizedCss = generated.target === "weapp" ? await (0, _weapp_tailwindcss_postcss.normalizeMiniProgramGeneratedCssForPostcss)(generationCss, {
|
|
2460
|
+
preservePreflight: true,
|
|
2461
|
+
preserveRawClassRules: true
|
|
2462
|
+
}) : generationCss;
|
|
2463
|
+
return filterGeneratedApplyOnlyCss(normalizedCss);
|
|
2464
|
+
};
|
|
2465
|
+
const restoreDeferredUserCss = async (css) => {
|
|
2466
|
+
if (generated.target !== "weapp" || generatedUserCssRawSource.trim().length === 0) return css;
|
|
2467
|
+
const userCssOptions = {
|
|
2468
|
+
generatorTarget: generated.target,
|
|
2469
|
+
generatorStyleOptions,
|
|
2470
|
+
cssUserHandlerOptions,
|
|
2471
|
+
styleHandler,
|
|
2472
|
+
importFallback: generatorOptions.importFallback,
|
|
2473
|
+
processed: userRawSourceProcessed
|
|
2474
|
+
};
|
|
2475
|
+
const transformDeferredUserCss = async (source) => {
|
|
2476
|
+
const parts = require_generator.splitUserCssLayerBlocks(source);
|
|
2477
|
+
const layerCss = await require_generator.transformGeneratorUserCss(parts.layer, userCssOptions);
|
|
2478
|
+
const restCss = await require_generator.transformGeneratorUserCss(parts.rest, userCssOptions);
|
|
2479
|
+
return createCssSourceOrderAppend$1(wrapUserLayerComponentsCss(layerCss), restCss);
|
|
2480
|
+
};
|
|
2481
|
+
const orderedUserCss = require_generator.splitGeneratorPlaceholderCssBySourceOrder(userCssOrderSource, generated.rawCss) ?? (hasMatchedCssSourceFile ? require_generator.splitTailwindV4GeneratedCssBySourceOrder(userCssOrderSource, generated.rawCss) : splitRawSourceByGeneratedCssOrder(userCssOrderSource, generated.rawCss));
|
|
2482
|
+
if (orderedUserCss) {
|
|
2483
|
+
const beforeUserCss = await transformDeferredUserCss(orderedUserCss.before);
|
|
2484
|
+
const afterUserCss = await transformDeferredUserCss(orderedUserCss.after);
|
|
2485
|
+
const cssWithBeforeUserCss = createCssSourceOrderAppend$1((0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, beforeUserCss), css);
|
|
2486
|
+
return reorderMarkedUserLayerComponentsCss(createCssSourceOrderAppend$1(cssWithBeforeUserCss, (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(cssWithBeforeUserCss, afterUserCss)));
|
|
2487
|
+
}
|
|
2488
|
+
return reorderMarkedUserLayerComponentsCss(createCssSourceOrderAppend$1(css, (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, await transformDeferredUserCss(generatedUserCssRawSource))));
|
|
2489
|
+
};
|
|
2490
|
+
const canAppendIncrementalCss = generated.target !== "weapp" || !require_generator.hasUserCssLayerBlocks(generatorRawSource);
|
|
2491
|
+
const incrementalRawCss = generated.incrementalRawCss ?? generated.incrementalCss;
|
|
2492
|
+
const shouldAppendIncrementalCss = canAppendIncrementalCss && typeof options.previousCss === "string" && typeof incrementalRawCss === "string";
|
|
2493
|
+
const normalizedCss = shouldAppendIncrementalCss ? incrementalRawCss.trim().length > 0 ? require_generator.createCssAppend(options.previousCss, await normalizeDeferredGeneratedCss(incrementalRawCss)) : options.previousCss : await normalizeDeferredGeneratedCss(generated.rawCss ?? generated.css);
|
|
2494
|
+
const css = (0, _weapp_tailwindcss_postcss.restoreLocalCssImports)(shouldAppendIncrementalCss ? normalizedCss : await restoreDeferredUserCss(normalizedCss), localImports, { outputFile: file });
|
|
2495
|
+
return {
|
|
2496
|
+
css,
|
|
2497
|
+
classSet: resolveGeneratedCssClassSet(generated.target, generated.classSet, runtimeWithCurrentCss, css, opts.escapeMap, options.previousClassSet),
|
|
2498
|
+
target: generated.target,
|
|
2499
|
+
source: "generator",
|
|
2500
|
+
dependencies: generated.dependencies,
|
|
2501
|
+
incremental: shouldAppendIncrementalCss,
|
|
2502
|
+
metadata: {
|
|
2503
|
+
file,
|
|
2504
|
+
majorVersion,
|
|
2505
|
+
preflightMode,
|
|
2506
|
+
rawCss: generated.rawCss
|
|
2507
|
+
}
|
|
2508
|
+
};
|
|
2509
|
+
}
|
|
2357
2510
|
if ((generated.target !== "weapp" || !require_generator.hasUserCssLayerBlocks(generatorRawSource)) && typeof options.previousCss === "string" && typeof generated.incrementalCss === "string") {
|
|
2358
2511
|
const incrementalCss = require_generator.stripTailwindBanner(generated.incrementalCss);
|
|
2359
2512
|
const css = incrementalCss.trim().length > 0 ? finalizeIncrementalGeneratorCss(options.previousCss, incrementalCss, generated.target, majorVersion, opts.cssPreflight, {
|
|
@@ -2375,33 +2528,7 @@ async function generateCssByGenerator(options) {
|
|
|
2375
2528
|
}
|
|
2376
2529
|
};
|
|
2377
2530
|
}
|
|
2378
|
-
const
|
|
2379
|
-
hasGeneratedCss,
|
|
2380
|
-
hasGeneratedMarkers
|
|
2381
|
-
});
|
|
2382
|
-
const generatedCssSource = generated.target === "web" ? generated.css : require_generator.stripTailwindBanner(generated.css);
|
|
2383
|
-
const generatedCss = shouldFilterApplyOnlyCss ? require_generator.filterApplyOnlyGeneratedCss(generatedCssSource, generatorRawSource, { preserveVariables: generated.target !== "web" }) : generatedCssSource;
|
|
2384
|
-
const hasMatchedCssSourceFile = generatorSources.some((source) => source.__weappTailwindcssMeta?.matchedCssSourceFile);
|
|
2385
|
-
const hasExplicitCssSource = generatorSources.some((source) => {
|
|
2386
|
-
const metadata = source.__weappTailwindcssMeta;
|
|
2387
|
-
return metadata?.candidateMatchedCssSource !== true && (metadata?.cssEntryIndex !== void 0 || metadata?.cssSourceIndex !== void 0);
|
|
2388
|
-
});
|
|
2389
|
-
const hasPreflightCssSource = generatorSources.some((source) => {
|
|
2390
|
-
const metadata = source.__weappTailwindcssMeta;
|
|
2391
|
-
const appEntryMatchedByCandidates = metadata?.candidateMatchedCssSource === true && metadata.cssEntryIndex === 0 && metadata.cssSourceIndex === void 0;
|
|
2392
|
-
return metadata?.includesPreflight === true && !appEntryMatchedByCandidates;
|
|
2393
|
-
});
|
|
2394
|
-
const hasPreflightRawSource = require_tailwindcss.includesTailwindV4PreflightDirective(generatorRawSource);
|
|
2395
|
-
const preflightMode = resolveMiniProgramPreflightModeForGeneratorCss(opts, {
|
|
2396
|
-
cssHandlerOptions,
|
|
2397
|
-
isolateCurrentCssCandidates,
|
|
2398
|
-
localImports,
|
|
2399
|
-
explicitCssSource: hasExplicitCssSource,
|
|
2400
|
-
primaryCssSource: generatorSources.length > 0 && generatorSources.every((source) => {
|
|
2401
|
-
const metadata = source.__weappTailwindcssMeta;
|
|
2402
|
-
return metadata?.candidateMatchedCssSource !== true && metadata?.primaryCssSource === true;
|
|
2403
|
-
}) || hasPreflightCssSource || hasPreflightRawSource
|
|
2404
|
-
});
|
|
2531
|
+
const generatedCss = filterGeneratedApplyOnlyCss(generated.target === "web" ? generated.css : require_generator.stripTailwindBanner(generated.css));
|
|
2405
2532
|
const orderedExtraCss = require_generator.splitGeneratorPlaceholderCssBySourceOrder(userCssOrderSource, generated.rawCss) ?? (hasMatchedCssSourceFile ? require_generator.splitTailwindV4GeneratedCssBySourceOrder(userCssOrderSource, generated.rawCss) : splitRawSourceByGeneratedCssOrder(userCssOrderSource, generated.rawCss));
|
|
2406
2533
|
const shouldAppendMatchedCssSourceCompat = !hasMatchedCssSourceFile || orderedExtraCss !== void 0;
|
|
2407
2534
|
if (orderedExtraCss) {
|
|
@@ -2468,6 +2595,8 @@ async function generateCssByGenerator(options) {
|
|
|
2468
2595
|
}
|
|
2469
2596
|
debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
|
|
2470
2597
|
let css = generatedCss;
|
|
2598
|
+
const distinctUserLayerParts = hasDistinctUserRawSource && require_generator.hasUserCssLayerBlocks(generatedUserCssRawSource) ? require_generator.splitUserCssLayerBlocks(generatedUserCssRawSource) : void 0;
|
|
2599
|
+
let restoredDistinctUserLayerCss = false;
|
|
2471
2600
|
if (generated.target === "weapp" && generatorRawSource.includes("weapp-tailwindcss generator-placeholder") && !require_generator.hasUserCssLayerBlocks(generatorRawSource)) css = createCssSourceOrderAppend$1(await require_generator.transformGeneratorUserCss(generatedUserCssRawSource, {
|
|
2472
2601
|
generatorTarget: generated.target,
|
|
2473
2602
|
generatorStyleOptions,
|
|
@@ -2497,10 +2626,26 @@ async function generateCssByGenerator(options) {
|
|
|
2497
2626
|
if (shouldFinalizeMarkedUserLayerComponentsCss(file)) css = reorderMarkedUserLayerComponentsCss(css);
|
|
2498
2627
|
}
|
|
2499
2628
|
}
|
|
2629
|
+
if (hasDistinctUserRawSource && distinctUserLayerParts) {
|
|
2630
|
+
const layerUserCss = await require_generator.transformGeneratorUserCss(distinctUserLayerParts.layer, {
|
|
2631
|
+
generatorTarget: generated.target,
|
|
2632
|
+
generatorStyleOptions,
|
|
2633
|
+
cssUserHandlerOptions,
|
|
2634
|
+
styleHandler,
|
|
2635
|
+
importFallback: generatorOptions.importFallback,
|
|
2636
|
+
processed: userRawSourceProcessed
|
|
2637
|
+
});
|
|
2638
|
+
if ((0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, layerUserCss).trim().length > 0) {
|
|
2639
|
+
css = createCssSourceOrderAppend$1(wrapUserLayerComponentsCss(layerUserCss), css);
|
|
2640
|
+
restoredDistinctUserLayerCss = true;
|
|
2641
|
+
if (shouldFinalizeMarkedUserLayerComponentsCss(file)) css = reorderMarkedUserLayerComponentsCss(css);
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2500
2644
|
}
|
|
2501
2645
|
if (hasMatchedCssSourceFile || generated.target === "web") {
|
|
2502
2646
|
if (generated.target === "weapp" && !hasGeneratedCss && !hasGeneratedMarkers) {
|
|
2503
|
-
const
|
|
2647
|
+
const distinctUserCssRawSource = restoredDistinctUserLayerCss ? distinctUserLayerParts?.rest ?? generatedUserCssRawSource : generatedUserCssRawSource;
|
|
2648
|
+
const userCss = await require_generator.transformGeneratorUserCss(distinctUserCssRawSource, {
|
|
2504
2649
|
generatorTarget: generated.target,
|
|
2505
2650
|
generatorStyleOptions,
|
|
2506
2651
|
cssUserHandlerOptions,
|
|
@@ -2508,10 +2653,11 @@ async function generateCssByGenerator(options) {
|
|
|
2508
2653
|
importFallback: generatorOptions.importFallback,
|
|
2509
2654
|
processed: userRawSourceProcessed
|
|
2510
2655
|
});
|
|
2511
|
-
const missingUserCss = isCssAlreadyRepresentedByMarkers(css,
|
|
2656
|
+
const missingUserCss = isCssAlreadyRepresentedByMarkers(css, distinctUserCssRawSource) ? (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, userCss) : userCss;
|
|
2512
2657
|
css = createCssSourceOrderAppend$1(css, missingUserCss);
|
|
2513
2658
|
} else if (hasMatchedCssSourceFile && generated.target === "weapp" && hasGeneratedMarkers && !hasGeneratedCss) {
|
|
2514
|
-
const
|
|
2659
|
+
const cleanedUserCssRawSource = require_generator.removeTailwindV4GeneratedUserCssArtifacts(userCssRawSource);
|
|
2660
|
+
const userCss = await require_generator.transformGeneratorUserCss(restoredDistinctUserLayerCss && require_generator.hasUserCssLayerBlocks(cleanedUserCssRawSource) ? require_generator.splitUserCssLayerBlocks(cleanedUserCssRawSource).rest : cleanedUserCssRawSource, {
|
|
2515
2661
|
generatorTarget: generated.target,
|
|
2516
2662
|
generatorStyleOptions,
|
|
2517
2663
|
cssUserHandlerOptions,
|
|
@@ -2576,7 +2722,8 @@ async function generateCssByGenerator(options) {
|
|
|
2576
2722
|
css = await appendLegacyContainerCompatCss(css, generatedUserCssRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
2577
2723
|
}
|
|
2578
2724
|
if (generated.target === "weapp" && hasDistinctUserRawSource && !hasGeneratedCss && !hasGeneratedMarkers && !require_generator.hasTailwindApplyDirective(generatedUserCssRawSource)) {
|
|
2579
|
-
const
|
|
2725
|
+
const distinctUserCssRawSource = restoredDistinctUserLayerCss ? distinctUserLayerParts?.rest ?? generatedUserCssRawSource : generatedUserCssRawSource;
|
|
2726
|
+
const userCss = await require_generator.transformGeneratorUserCss(distinctUserCssRawSource, {
|
|
2580
2727
|
generatorTarget: generated.target,
|
|
2581
2728
|
generatorStyleOptions,
|
|
2582
2729
|
cssUserHandlerOptions,
|
|
@@ -2584,7 +2731,7 @@ async function generateCssByGenerator(options) {
|
|
|
2584
2731
|
importFallback: generatorOptions.importFallback,
|
|
2585
2732
|
processed: userRawSourceProcessed
|
|
2586
2733
|
});
|
|
2587
|
-
const missingUserCss = isCssAlreadyRepresentedByMarkers(css,
|
|
2734
|
+
const missingUserCss = isCssAlreadyRepresentedByMarkers(css, distinctUserCssRawSource) ? (0, _weapp_tailwindcss_postcss.filterExistingCssRules)(css, userCss) : userCss;
|
|
2588
2735
|
css = createCssSourceOrderAppend$1(css, missingUserCss);
|
|
2589
2736
|
}
|
|
2590
2737
|
const finalCss = finalizeGeneratorCss(css, generated.target, {
|
|
@@ -2893,10 +3040,66 @@ const SCRIPT_SOURCE_CANDIDATE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
2893
3040
|
"mts",
|
|
2894
3041
|
"cts"
|
|
2895
3042
|
]);
|
|
3043
|
+
const TEMPLATE_SOURCE_CANDIDATE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
3044
|
+
"html",
|
|
3045
|
+
"wxml",
|
|
3046
|
+
"axml",
|
|
3047
|
+
"jxml",
|
|
3048
|
+
"ksml",
|
|
3049
|
+
"ttml",
|
|
3050
|
+
"qml",
|
|
3051
|
+
"tyml",
|
|
3052
|
+
"xhsml",
|
|
3053
|
+
"swan",
|
|
3054
|
+
"vue",
|
|
3055
|
+
"uvue",
|
|
3056
|
+
"nvue",
|
|
3057
|
+
"mpx"
|
|
3058
|
+
]);
|
|
2896
3059
|
async function extractCandidatesFromSource(source, extension, options = {}) {
|
|
2897
3060
|
const candidates = options.extractor ? new Set(await options.extractor(source, extension)) : new Set(await (0, _tailwindcss_mangle_engine.extractSourceCandidates)(source, extension, { ...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } }));
|
|
2898
3061
|
const scriptCandidates = await extractScriptStringCandidates(source, extension, options);
|
|
2899
3062
|
for (const candidate of scriptCandidates) candidates.add(candidate);
|
|
3063
|
+
const templateAttributeCandidates = await extractTemplateAttributeCandidates(source, extension, options);
|
|
3064
|
+
for (const candidate of templateAttributeCandidates) candidates.add(candidate);
|
|
3065
|
+
return candidates;
|
|
3066
|
+
}
|
|
3067
|
+
function isDefaultTemplateAttribute(name) {
|
|
3068
|
+
if (name === "class" || name === "hover-class" || name === "virtualhostclass") return true;
|
|
3069
|
+
const lowerName = name.toLowerCase();
|
|
3070
|
+
return lowerName === "class" || lowerName === "hover-class" || lowerName === "virtualhostclass";
|
|
3071
|
+
}
|
|
3072
|
+
async function extractCandidateTokensFromTemplateAttributeValue(value, options) {
|
|
3073
|
+
return options.extractor ? await options.extractor(value, "html") : await (0, _tailwindcss_mangle_engine.extractSourceCandidates)(value, "html", { ...options.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: options.bareArbitraryValues } });
|
|
3074
|
+
}
|
|
3075
|
+
async function extractTemplateAttributeCandidates(source, extension, options) {
|
|
3076
|
+
if (!TEMPLATE_SOURCE_CANDIDATE_EXTENSIONS.has(extension)) return [];
|
|
3077
|
+
if (!options.customAttributesEntities?.length) return [];
|
|
3078
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
3079
|
+
const matchCustomAttribute = require_wxml.createAttributeMatcher(options.customAttributesEntities);
|
|
3080
|
+
const defaultTemplateHandlerEnabled = !options.disabledDefaultTemplateHandler;
|
|
3081
|
+
let tag = "";
|
|
3082
|
+
const tasks = [];
|
|
3083
|
+
const parser = new require_wxml.Parser({
|
|
3084
|
+
onopentagname(name) {
|
|
3085
|
+
tag = name;
|
|
3086
|
+
},
|
|
3087
|
+
onattribute(name, value) {
|
|
3088
|
+
if (!value) return;
|
|
3089
|
+
const shouldHandleDefault = defaultTemplateHandlerEnabled && isDefaultTemplateAttribute(name);
|
|
3090
|
+
const shouldHandleCustom = matchCustomAttribute?.(tag, name) ?? false;
|
|
3091
|
+
if (!shouldHandleDefault && !shouldHandleCustom) return;
|
|
3092
|
+
tasks.push((async () => {
|
|
3093
|
+
for (const candidate of await extractCandidateTokensFromTemplateAttributeValue(value, options)) candidates.add(candidate);
|
|
3094
|
+
})());
|
|
3095
|
+
},
|
|
3096
|
+
onclosetag() {
|
|
3097
|
+
tag = "";
|
|
3098
|
+
}
|
|
3099
|
+
}, { xmlMode: true });
|
|
3100
|
+
parser.write(source);
|
|
3101
|
+
parser.end();
|
|
3102
|
+
await Promise.all(tasks);
|
|
2900
3103
|
return candidates;
|
|
2901
3104
|
}
|
|
2902
3105
|
async function extractScriptStringCandidates(source, extension, options) {
|
|
@@ -3046,8 +3249,21 @@ function resolveSourceCandidateExtension(id) {
|
|
|
3046
3249
|
const normalized = cleanUrl(id);
|
|
3047
3250
|
return /\.([^.\\/]+)$/.exec(normalized)?.[1] ?? "html";
|
|
3048
3251
|
}
|
|
3049
|
-
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues, extractor) {
|
|
3050
|
-
return
|
|
3252
|
+
function createSourceCandidateContentCacheKey(extension, source, bareArbitraryValues, customAttributesEntities, disabledDefaultTemplateHandler, extractor) {
|
|
3253
|
+
return [
|
|
3254
|
+
extension,
|
|
3255
|
+
JSON.stringify(bareArbitraryValues ?? false),
|
|
3256
|
+
createCustomAttributesCacheSignature(customAttributesEntities),
|
|
3257
|
+
disabledDefaultTemplateHandler === true ? "default-template:off" : "default-template:on",
|
|
3258
|
+
extractor ? "custom" : "default",
|
|
3259
|
+
(0, _weapp_tailwindcss_shared_node.md5)(source)
|
|
3260
|
+
].join("\0");
|
|
3261
|
+
}
|
|
3262
|
+
function createCustomAttributesCacheSignature(customAttributesEntities) {
|
|
3263
|
+
return JSON.stringify((customAttributesEntities ?? []).map(([selector, props]) => [stringifyCustomAttributeToken(selector), Array.isArray(props) ? props.map(stringifyCustomAttributeToken) : stringifyCustomAttributeToken(props)]));
|
|
3264
|
+
}
|
|
3265
|
+
function stringifyCustomAttributeToken(token) {
|
|
3266
|
+
return typeof token === "string" ? `s:${token}` : `r:${token.source}/${token.flags}`;
|
|
3051
3267
|
}
|
|
3052
3268
|
async function extractCandidates(source, extension, options) {
|
|
3053
3269
|
return extractCandidatesFromSource(source, extension, options);
|
|
@@ -3094,7 +3310,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
3094
3310
|
const normalizedId = cleanUrl(id);
|
|
3095
3311
|
scanSourceById.set(normalizedId, source);
|
|
3096
3312
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
3097
|
-
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.extractor);
|
|
3313
|
+
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.customAttributesEntities, options.disabledDefaultTemplateHandler, options.extractor);
|
|
3098
3314
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
3099
3315
|
if (cachedCandidates) {
|
|
3100
3316
|
replaceScanLayer(normalizedId, new Set(cachedCandidates));
|
|
@@ -3107,7 +3323,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
3107
3323
|
async function syncCss(id, source) {
|
|
3108
3324
|
const normalizedId = cleanUrl(id);
|
|
3109
3325
|
cssSourceById.set(normalizedId, source);
|
|
3110
|
-
const contentCacheKey = createSourceCandidateContentCacheKey("css", source, options.bareArbitraryValues, options.extractor);
|
|
3326
|
+
const contentCacheKey = createSourceCandidateContentCacheKey("css", source, options.bareArbitraryValues, options.customAttributesEntities, options.disabledDefaultTemplateHandler, options.extractor);
|
|
3111
3327
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
3112
3328
|
if (cachedCandidates) {
|
|
3113
3329
|
replaceCssLayer(normalizedId, new Set(cachedCandidates));
|
|
@@ -3121,7 +3337,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
3121
3337
|
const normalizedId = cleanUrl(id);
|
|
3122
3338
|
transformSourceById.set(normalizedId, source);
|
|
3123
3339
|
const extension = resolveSourceCandidateExtension(normalizedId);
|
|
3124
|
-
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.extractor);
|
|
3340
|
+
const contentCacheKey = createSourceCandidateContentCacheKey(extension, source, options.bareArbitraryValues, options.customAttributesEntities, options.disabledDefaultTemplateHandler, options.extractor);
|
|
3125
3341
|
const cachedCandidates = sourceCandidateContentCache.get(contentCacheKey);
|
|
3126
3342
|
const extractedCandidates = cachedCandidates ? new Set(cachedCandidates) : await extractCandidates(source, extension, options);
|
|
3127
3343
|
if (!cachedCandidates) sourceCandidateContentCache.set(contentCacheKey, [...extractedCandidates]);
|
|
@@ -3462,6 +3678,12 @@ Object.defineProperty(exports, "annotateCssSourceTrace", {
|
|
|
3462
3678
|
return annotateCssSourceTrace;
|
|
3463
3679
|
}
|
|
3464
3680
|
});
|
|
3681
|
+
Object.defineProperty(exports, "collectRawSourceClassSelectors", {
|
|
3682
|
+
enumerable: true,
|
|
3683
|
+
get: function() {
|
|
3684
|
+
return collectRawSourceClassSelectors;
|
|
3685
|
+
}
|
|
3686
|
+
});
|
|
3465
3687
|
Object.defineProperty(exports, "collectStrictEscapedRuntimeCandidates", {
|
|
3466
3688
|
enumerable: true,
|
|
3467
3689
|
get: function() {
|
|
@@ -3474,6 +3696,12 @@ Object.defineProperty(exports, "createBundleRuntimeClassSetManager", {
|
|
|
3474
3696
|
return createBundleRuntimeClassSetManager;
|
|
3475
3697
|
}
|
|
3476
3698
|
});
|
|
3699
|
+
Object.defineProperty(exports, "createBundlerGeneratedCssMarker", {
|
|
3700
|
+
enumerable: true,
|
|
3701
|
+
get: function() {
|
|
3702
|
+
return createBundlerGeneratedCssMarker;
|
|
3703
|
+
}
|
|
3704
|
+
});
|
|
3477
3705
|
Object.defineProperty(exports, "createCssSourceOrderAppend", {
|
|
3478
3706
|
enumerable: true,
|
|
3479
3707
|
get: function() {
|
|
@@ -3522,18 +3750,36 @@ Object.defineProperty(exports, "emitHmrTiming", {
|
|
|
3522
3750
|
return emitHmrTiming;
|
|
3523
3751
|
}
|
|
3524
3752
|
});
|
|
3753
|
+
Object.defineProperty(exports, "extractCandidatesFromSource", {
|
|
3754
|
+
enumerable: true,
|
|
3755
|
+
get: function() {
|
|
3756
|
+
return extractCandidatesFromSource;
|
|
3757
|
+
}
|
|
3758
|
+
});
|
|
3525
3759
|
Object.defineProperty(exports, "extractMarkedUserLayerComponentsCss", {
|
|
3526
3760
|
enumerable: true,
|
|
3527
3761
|
get: function() {
|
|
3528
3762
|
return extractMarkedUserLayerComponentsCss;
|
|
3529
3763
|
}
|
|
3530
3764
|
});
|
|
3765
|
+
Object.defineProperty(exports, "finalizeMiniProgramGeneratorCss", {
|
|
3766
|
+
enumerable: true,
|
|
3767
|
+
get: function() {
|
|
3768
|
+
return finalizeMiniProgramGeneratorCss;
|
|
3769
|
+
}
|
|
3770
|
+
});
|
|
3531
3771
|
Object.defineProperty(exports, "generateCssByGenerator", {
|
|
3532
3772
|
enumerable: true,
|
|
3533
3773
|
get: function() {
|
|
3534
3774
|
return generateCssByGenerator;
|
|
3535
3775
|
}
|
|
3536
3776
|
});
|
|
3777
|
+
Object.defineProperty(exports, "hasBundlerGeneratedCssMarker", {
|
|
3778
|
+
enumerable: true,
|
|
3779
|
+
get: function() {
|
|
3780
|
+
return hasBundlerGeneratedCssMarker;
|
|
3781
|
+
}
|
|
3782
|
+
});
|
|
3537
3783
|
Object.defineProperty(exports, "hasMiniProgramTailwindV4PreflightReset", {
|
|
3538
3784
|
enumerable: true,
|
|
3539
3785
|
get: function() {
|
|
@@ -3552,6 +3798,12 @@ Object.defineProperty(exports, "isSourceCandidateRequest", {
|
|
|
3552
3798
|
return isSourceCandidateRequest;
|
|
3553
3799
|
}
|
|
3554
3800
|
});
|
|
3801
|
+
Object.defineProperty(exports, "isSourceStyleRequest", {
|
|
3802
|
+
enumerable: true,
|
|
3803
|
+
get: function() {
|
|
3804
|
+
return isSourceStyleRequest;
|
|
3805
|
+
}
|
|
3806
|
+
});
|
|
3555
3807
|
Object.defineProperty(exports, "mergeMarkedUserLayerComponentsCss", {
|
|
3556
3808
|
enumerable: true,
|
|
3557
3809
|
get: function() {
|
|
@@ -3570,6 +3822,12 @@ Object.defineProperty(exports, "normalizeMiniProgramImportShell", {
|
|
|
3570
3822
|
return normalizeMiniProgramImportShell;
|
|
3571
3823
|
}
|
|
3572
3824
|
});
|
|
3825
|
+
Object.defineProperty(exports, "parseBundlerGeneratedCssMarkerBlocks", {
|
|
3826
|
+
enumerable: true,
|
|
3827
|
+
get: function() {
|
|
3828
|
+
return parseBundlerGeneratedCssMarkerBlocks;
|
|
3829
|
+
}
|
|
3830
|
+
});
|
|
3573
3831
|
Object.defineProperty(exports, "processCachedTask", {
|
|
3574
3832
|
enumerable: true,
|
|
3575
3833
|
get: function() {
|
|
@@ -3612,6 +3870,18 @@ Object.defineProperty(exports, "scoreTailwindV4CssSourceFileMatch", {
|
|
|
3612
3870
|
return scoreTailwindV4CssSourceFileMatch;
|
|
3613
3871
|
}
|
|
3614
3872
|
});
|
|
3873
|
+
Object.defineProperty(exports, "stripBundlerGeneratedCssMarkers", {
|
|
3874
|
+
enumerable: true,
|
|
3875
|
+
get: function() {
|
|
3876
|
+
return stripBundlerGeneratedCssMarkers;
|
|
3877
|
+
}
|
|
3878
|
+
});
|
|
3879
|
+
Object.defineProperty(exports, "stripRequestQuery", {
|
|
3880
|
+
enumerable: true,
|
|
3881
|
+
get: function() {
|
|
3882
|
+
return stripRequestQuery;
|
|
3883
|
+
}
|
|
3884
|
+
});
|
|
3615
3885
|
Object.defineProperty(exports, "validateCandidatesByGenerator", {
|
|
3616
3886
|
enumerable: true,
|
|
3617
3887
|
get: function() {
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_framework = require("./framework.js");
|
|
3
|
-
const require_generator = require("./generator-
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
3
|
+
const require_generator = require("./generator-CEnUsjed.js");
|
|
4
|
+
const require_gulp = require("./gulp-3m1dAiig.js");
|
|
5
5
|
const require_postcss = require("./postcss.js");
|
|
6
|
-
const require_vite = require("./vite-
|
|
7
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-DUVjMduj.js");
|
|
7
|
+
const require_webpack = require("./webpack-nppysF4B.js");
|
|
8
8
|
require("./webpack.js");
|
|
9
9
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
10
10
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform } from "./framework.mjs";
|
|
2
|
-
import { t as createWeappTailwindcssGenerator } from "./generator-
|
|
3
|
-
import { t as createPlugins } from "./gulp-
|
|
2
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-CEo920So.mjs";
|
|
3
|
+
import { t as createPlugins } from "./gulp-DP71z1jG.mjs";
|
|
4
4
|
import weappTailwindcssPostcssPlugin from "./postcss.mjs";
|
|
5
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
6
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-nXZEiwG0.mjs";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-C_UUFRgj.mjs";
|
|
7
7
|
import "./webpack.mjs";
|
|
8
8
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
9
9
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveMpxPlatform, resolvePlatform, resolveTaroPlatform, resolveUniAppXPlatform, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
package/dist/postcss.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_generator = require("./generator-
|
|
5
|
+
const require_generator = require("./generator-CEnUsjed.js");
|
|
6
6
|
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
7
7
|
createGenerator: (source) => {
|
|
8
8
|
return require_generator.createWeappTailwindcssGenerator(source);
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-
|
|
1
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-CEo920So.mjs";
|
|
2
2
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
3
3
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
4
4
|
createGenerator: (source) => {
|
package/dist/presets.js
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
3
3
|
const require_framework = require("./framework.js");
|
|
4
4
|
const require_object = require("./object-COs_Mw6p.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-KBYPJ2DW.js");
|
|
6
6
|
require("./utils-CuKLf1Zv.js");
|
|
7
7
|
require("./logger-TlKT3xmR.js");
|
|
8
8
|
let node_path = require("node:path");
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveTaroPlatform, resolveUniPlatformsFromEnv } from "./framework.mjs";
|
|
2
2
|
import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-xs704TRw.mjs";
|
|
4
4
|
import { n as defuOverrideArray } from "./utils-MVwpU07P.mjs";
|
|
5
5
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
6
6
|
import path from "node:path";
|