weapp-tailwindcss 5.1.9 → 5.1.10
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/bundlers/shared/generator-css/generation-helpers.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/types.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +1 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +7 -2
- package/dist/bundlers/vite/web-css-compat.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +3 -0
- package/dist/cli.js +3 -2
- package/dist/cli.mjs +2 -1
- package/dist/{context-CfXr3hWz.mjs → context-DzkSFEVL.mjs} +4 -4
- package/dist/{context-CRhUs_5e.js → context-y2BGCok4.js} +10 -10
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/generator/options.d.ts +8 -1
- package/dist/{v4-engine-BZP2462H.js → generator-Bz94KTkH.js} +229 -17
- package/dist/{v4-engine-CjjWONB0.mjs → generator-ROzBodj6.mjs} +185 -9
- package/dist/generator.js +7 -8
- package/dist/generator.mjs +1 -2
- package/dist/{gulp-CRjkPsbX.mjs → gulp-BKqMb_Ds.mjs} +4 -4
- package/dist/{gulp-JUfnhOOo.js → gulp-DfOLvYLs.js} +10 -10
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DcIEXnf8.js → hmr-timing-DOTdH18A.js} +556 -170
- package/dist/{hmr-timing-BecOXMd8.mjs → hmr-timing-DwtYJdwb.mjs} +430 -56
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/postcss.js +2 -3
- package/dist/postcss.mjs +1 -2
- package/dist/presets.js +7 -6
- package/dist/presets.mjs +5 -4
- package/dist/rspack.js +1 -1
- package/dist/rspack.mjs +1 -1
- package/dist/{source-candidate-scan-signature-10tvdJVC.js → source-candidate-scan-signature-BrWuBTjY.js} +34 -6
- package/dist/{source-candidate-scan-signature-DAg8QSgh.mjs → source-candidate-scan-signature-CQ04hiox.mjs} +29 -7
- package/dist/{tailwindcss-BZjZZi60.js → tailwindcss-Dn5DVlkI.js} +55 -47
- package/dist/{tailwindcss-PA2jHHpx.mjs → tailwindcss-hzy_WaC9.mjs} +14 -6
- package/dist/{transform-wNEbcZeQ.mjs → transform-BgnNYkIG.mjs} +1 -1
- package/dist/{transform-B0BxX3XB.js → transform-DZQETx51.js} +1 -1
- package/dist/{vite-ClpyoD9e.mjs → vite-BimHmlSp.mjs} +824 -207
- package/dist/{vite-CHk7V9EA.js → vite-bztpcI8_.js} +871 -254
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +613 -63
- package/dist/{webpack-2s-TFhgm.mjs → webpack-CCapGlNg.mjs} +235 -38
- package/dist/{webpack-BhM4Hqla.js → webpack-XxBCIrBp.js} +276 -79
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +6 -6
- package/dist/generator-DaaFxR5V.js +0 -174
- package/dist/generator-DugIHBgl.mjs +0 -127
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
|
|
2
2
|
require("./auto-DtU6f3X6.js");
|
|
3
|
+
const require_utils = require("./utils-D3h8j7Mk.js");
|
|
3
4
|
let node_fs = require("node:fs");
|
|
4
5
|
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
5
6
|
let node_path = require("node:path");
|
|
@@ -9,10 +10,10 @@ node_process = require_rolldown_runtime.__toESM(node_process);
|
|
|
9
10
|
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
10
11
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
11
12
|
let lru_cache = require("lru-cache");
|
|
13
|
+
let node_module = require("node:module");
|
|
12
14
|
let node_fs_promises = require("node:fs/promises");
|
|
13
15
|
let micromatch = require("micromatch");
|
|
14
16
|
micromatch = require_rolldown_runtime.__toESM(micromatch);
|
|
15
|
-
let node_module = require("node:module");
|
|
16
17
|
//#region src/runtime-branch/generator-target-env.ts
|
|
17
18
|
const explicitGeneratorTargetEnvKeys = ["WEAPP_TW_TARGET", "WEAPP_TAILWINDCSS_TARGET"];
|
|
18
19
|
const uniWebPlatformEnvKeys = ["UNI_PLATFORM", "UNI_UTS_PLATFORM"];
|
|
@@ -445,6 +446,8 @@ function createTailwindV4DefaultColorThemeCss() {
|
|
|
445
446
|
}
|
|
446
447
|
//#endregion
|
|
447
448
|
//#region src/tailwindcss/v4-engine/generator/css-compat.ts
|
|
449
|
+
const require$2 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
450
|
+
const tailwindThemeCssCache = /* @__PURE__ */ new Map();
|
|
448
451
|
function findLeadingImportInsertionIndex(css) {
|
|
449
452
|
const importPattern = /(?:^|\n)\s*@import\b[^;]*;/g;
|
|
450
453
|
let insertionIndex = 0;
|
|
@@ -455,8 +458,46 @@ function findLeadingImportInsertionIndex(css) {
|
|
|
455
458
|
}
|
|
456
459
|
return insertionIndex;
|
|
457
460
|
}
|
|
458
|
-
function
|
|
459
|
-
const
|
|
461
|
+
function readCachedCss(file) {
|
|
462
|
+
const cached = tailwindThemeCssCache.get(file);
|
|
463
|
+
if (cached !== void 0) return cached;
|
|
464
|
+
const css = (0, node_fs.readFileSync)(file, "utf8");
|
|
465
|
+
tailwindThemeCssCache.set(file, css);
|
|
466
|
+
return css;
|
|
467
|
+
}
|
|
468
|
+
function resolveTailwindV4ThemeCssFromImport(css) {
|
|
469
|
+
const root = _weapp_tailwindcss_postcss.postcss.parse(css);
|
|
470
|
+
let resolved;
|
|
471
|
+
root.walkAtRules("import", (rule) => {
|
|
472
|
+
if (resolved) return;
|
|
473
|
+
const specifier = parseCssImportSpecifier$2(rule.params);
|
|
474
|
+
if (!specifier || !node_path.default.isAbsolute(specifier) || node_path.default.basename(specifier) !== "index.css") return;
|
|
475
|
+
const themeCss = node_path.default.join(node_path.default.dirname(specifier), "theme.css");
|
|
476
|
+
if ((0, node_fs.existsSync)(themeCss)) resolved = themeCss;
|
|
477
|
+
});
|
|
478
|
+
return resolved;
|
|
479
|
+
}
|
|
480
|
+
function resolveTailwindV4ThemeCssFromBase(base) {
|
|
481
|
+
try {
|
|
482
|
+
return (0, node_module.createRequire)(node_path.default.join(base, "package.json")).resolve("tailwindcss/theme.css");
|
|
483
|
+
} catch {
|
|
484
|
+
try {
|
|
485
|
+
return require$2.resolve("tailwindcss/theme.css");
|
|
486
|
+
} catch {
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
function resolveTailwindV4DefaultThemeCss(source) {
|
|
492
|
+
try {
|
|
493
|
+
const themeCss = resolveTailwindV4ThemeCssFromImport(source.css) ?? resolveTailwindV4ThemeCssFromBase(source.base);
|
|
494
|
+
return themeCss ? readCachedCss(themeCss) : createTailwindV4DefaultColorThemeCss();
|
|
495
|
+
} catch {
|
|
496
|
+
return createTailwindV4DefaultColorThemeCss();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
function applyMiniProgramTailwindV4DefaultColorCss(css, source) {
|
|
500
|
+
const themeCss = resolveTailwindV4DefaultThemeCss(source);
|
|
460
501
|
const insertionIndex = findLeadingImportInsertionIndex(css);
|
|
461
502
|
if (insertionIndex === 0) return `${themeCss}\n${css}`;
|
|
462
503
|
return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
|
|
@@ -519,7 +560,7 @@ function removeUnsupportedThemeVendorKeyframes(css) {
|
|
|
519
560
|
}
|
|
520
561
|
function createCompatibleSource(source, target) {
|
|
521
562
|
const filteredSourceCss = target === "weapp" ? removeTailwindV4PreflightImports(source.css) : source.css;
|
|
522
|
-
const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss) : filteredSourceCss);
|
|
563
|
+
const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss, source) : filteredSourceCss);
|
|
523
564
|
return compatibleSourceCss === source.css ? source : {
|
|
524
565
|
...source,
|
|
525
566
|
css: compatibleSourceCss
|
|
@@ -1110,8 +1151,8 @@ async function transformTailwindV4CssByTarget(css, target, options) {
|
|
|
1110
1151
|
//#region src/tailwindcss/v4-engine/generator.ts
|
|
1111
1152
|
const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
1112
1153
|
const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
1113
|
-
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX =
|
|
1114
|
-
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX =
|
|
1154
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12e3;
|
|
1155
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 2 * 1024 * 1024;
|
|
1115
1156
|
const incrementalGenerateCache = new lru_cache.LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX });
|
|
1116
1157
|
const incrementalGenerateTaskCache = new lru_cache.LRUCache({ max: INCREMENTAL_GENERATE_TASK_CACHE_MAX });
|
|
1117
1158
|
function collectCandidates(candidates) {
|
|
@@ -1256,6 +1297,9 @@ function normalizeTargetRpxLengthCandidates(candidates, target, styleOptions) {
|
|
|
1256
1297
|
restoreCandidates: /* @__PURE__ */ new Map()
|
|
1257
1298
|
};
|
|
1258
1299
|
}
|
|
1300
|
+
function resolveGeneratedSourcePatterns(generatedSources, scanSources) {
|
|
1301
|
+
return Array.isArray(scanSources) ? scanSources : generatedSources;
|
|
1302
|
+
}
|
|
1259
1303
|
function createTailwindV4Engine(source) {
|
|
1260
1304
|
async function generateOnce(generateSource, options = {}) {
|
|
1261
1305
|
const { scanSources = true, styleOptions, target = "weapp", ...patchOptions } = options;
|
|
@@ -1270,10 +1314,12 @@ function createTailwindV4Engine(source) {
|
|
|
1270
1314
|
...patchOptions,
|
|
1271
1315
|
candidates: normalizedCandidates.candidates
|
|
1272
1316
|
}));
|
|
1317
|
+
const sources = resolveGeneratedSourcePatterns(result.sources, resolvedScanSources);
|
|
1273
1318
|
const rawCss = restoreRpxLengthCssSelectors(result.css, normalizedCandidates.restoreCandidates);
|
|
1274
1319
|
const css = await transformTailwindV4CssByTarget(rawCss, target, resolvedStyleOptions);
|
|
1275
1320
|
return {
|
|
1276
1321
|
...result,
|
|
1322
|
+
sources,
|
|
1277
1323
|
classSet: restoreRpxLengthCandidates(result.classSet, normalizedCandidates.restoreCandidates),
|
|
1278
1324
|
rawCandidates: restoreRpxLengthCandidates(result.rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1279
1325
|
css,
|
|
@@ -1295,7 +1341,7 @@ function createTailwindV4Engine(source) {
|
|
|
1295
1341
|
compatibleSource,
|
|
1296
1342
|
generated,
|
|
1297
1343
|
requestedCandidates,
|
|
1298
|
-
styleOptions
|
|
1344
|
+
styleOptions,
|
|
1299
1345
|
target
|
|
1300
1346
|
})) incrementalGenerateCache.delete(cacheKey);
|
|
1301
1347
|
return generated;
|
|
@@ -2406,10 +2452,10 @@ function shouldFilterApplyOnlyGeneratedCss(_majorVersion, target, source, option
|
|
|
2406
2452
|
}
|
|
2407
2453
|
async function transformGeneratorUserCss(source, options) {
|
|
2408
2454
|
if (source.trim().length === 0) return "";
|
|
2409
|
-
if (options.processed) return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(removeProcessedMiniProgramUnsupportedCss(source, {
|
|
2455
|
+
if (options.processed) return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(unwrapMiniProgramCascadeLayers(removeProcessedMiniProgramUnsupportedCss(source, {
|
|
2410
2456
|
...options.generatorStyleOptions,
|
|
2411
2457
|
...options.cssUserHandlerOptions
|
|
2412
|
-
})) : source)));
|
|
2458
|
+
}))) : source)));
|
|
2413
2459
|
const cleanedSource = removeTailwindSourceDirectives(removeTailwindV4GeneratorAtRules(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(source))), { importFallback: options.importFallback });
|
|
2414
2460
|
if (cleanedSource.trim().length === 0) return "";
|
|
2415
2461
|
const userSource = stripUnmatchedTailwindSourceMediaCloseFragments(removeTailwindApplyAtRules(removeTailwindSourceDirectives(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts((0, _weapp_tailwindcss_postcss.removeUnsupportedMiniProgramAtRules)(unwrapMiniProgramCascadeLayers(cleanedSource))) : cleanedSource)), { importFallback: options.importFallback })));
|
|
@@ -2884,6 +2930,136 @@ async function resolveTailwindV4SourceFromRuntime(runtime) {
|
|
|
2884
2930
|
return resolveTailwindV4Source(resolveTailwindV4SourceOptionsFromRuntime(runtime));
|
|
2885
2931
|
}
|
|
2886
2932
|
//#endregion
|
|
2933
|
+
//#region src/runtime-branch/create-branch.ts
|
|
2934
|
+
function createRuntimeBranch(base, platformFamily, options) {
|
|
2935
|
+
const { context, tailwindcssVersion } = base;
|
|
2936
|
+
return {
|
|
2937
|
+
tailwindcssVersion,
|
|
2938
|
+
generatorTarget: context.generatorTarget,
|
|
2939
|
+
platformFamily,
|
|
2940
|
+
platform: options.platform,
|
|
2941
|
+
nativeAppPlatform: options.nativeAppPlatform,
|
|
2942
|
+
isTailwindV4: tailwindcssVersion === 4,
|
|
2943
|
+
isWeb: platformFamily === "web",
|
|
2944
|
+
isMiniProgram: platformFamily === "mini-program",
|
|
2945
|
+
isNativeApp: platformFamily === "native-app"
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
//#endregion
|
|
2949
|
+
//#region src/runtime-branch/mini-program.ts
|
|
2950
|
+
function createMiniProgramRuntimeBranch(base) {
|
|
2951
|
+
const { context, uniUtsPlatform } = base;
|
|
2952
|
+
return createRuntimeBranch(base, "mini-program", { platform: typeof context.platform === "string" && context.platform.length > 0 ? context.platform : uniUtsPlatform.isMp ? uniUtsPlatform.normalized : context.platform });
|
|
2953
|
+
}
|
|
2954
|
+
//#endregion
|
|
2955
|
+
//#region src/runtime-branch/platform.ts
|
|
2956
|
+
function isRuntimeUniAppXEnabled(value) {
|
|
2957
|
+
return value === true || typeof value === "object" && value?.enabled !== false;
|
|
2958
|
+
}
|
|
2959
|
+
function normalizeRuntimeUniUtsPlatform(value) {
|
|
2960
|
+
return typeof value === "object" && value !== null ? value : require_utils.resolveUniUtsPlatform(value);
|
|
2961
|
+
}
|
|
2962
|
+
function resolveNativeAppPlatform(platform) {
|
|
2963
|
+
if (platform.isAppAndroid) return "android";
|
|
2964
|
+
if (platform.isAppIos) return "ios";
|
|
2965
|
+
if (platform.isAppHarmony) return "harmony";
|
|
2966
|
+
return "unknown";
|
|
2967
|
+
}
|
|
2968
|
+
function resolveExplicitOrEnvPlatform(context, uniUtsPlatform) {
|
|
2969
|
+
if (typeof context.platform === "string" && context.platform.length > 0) return context.platform;
|
|
2970
|
+
return uniUtsPlatform.normalized;
|
|
2971
|
+
}
|
|
2972
|
+
//#endregion
|
|
2973
|
+
//#region src/runtime-branch/native-app.ts
|
|
2974
|
+
function createNativeAppRuntimeBranch(base) {
|
|
2975
|
+
return createRuntimeBranch(base, "native-app", {
|
|
2976
|
+
platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform),
|
|
2977
|
+
nativeAppPlatform: resolveNativeAppPlatform(base.uniUtsPlatform)
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
//#endregion
|
|
2981
|
+
//#region src/runtime-branch/tailwind-version.ts
|
|
2982
|
+
function resolveTailwindcssBranchVersion(_majorVersion) {
|
|
2983
|
+
return 4;
|
|
2984
|
+
}
|
|
2985
|
+
//#endregion
|
|
2986
|
+
//#region src/runtime-branch/web.ts
|
|
2987
|
+
function createWebRuntimeBranch(base) {
|
|
2988
|
+
return createRuntimeBranch(base, "web", { platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform) });
|
|
2989
|
+
}
|
|
2990
|
+
//#endregion
|
|
2991
|
+
//#region src/runtime-branch/index.ts
|
|
2992
|
+
function shouldUseNativeAppBranch(base, uniUtsPlatform) {
|
|
2993
|
+
return base.appType === "uni-app-x" && isRuntimeUniAppXEnabled(base.uniAppX) && uniUtsPlatform.isApp;
|
|
2994
|
+
}
|
|
2995
|
+
function resolveRuntimeBranch(context) {
|
|
2996
|
+
const uniUtsPlatform = normalizeRuntimeUniUtsPlatform(context.uniUtsPlatform);
|
|
2997
|
+
const base = {
|
|
2998
|
+
context,
|
|
2999
|
+
tailwindcssVersion: resolveTailwindcssBranchVersion(context.tailwindcssMajorVersion),
|
|
3000
|
+
uniUtsPlatform
|
|
3001
|
+
};
|
|
3002
|
+
if (context.generatorTarget === "web") return createWebRuntimeBranch(base);
|
|
3003
|
+
if (shouldUseNativeAppBranch(context, uniUtsPlatform)) return createNativeAppRuntimeBranch(base);
|
|
3004
|
+
return createMiniProgramRuntimeBranch(base);
|
|
3005
|
+
}
|
|
3006
|
+
function resolveGeneratorRuntimeBranch(options, context = {}) {
|
|
3007
|
+
return options.branch ?? resolveRuntimeBranch({
|
|
3008
|
+
...context,
|
|
3009
|
+
generatorTarget: options.target
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
function shouldUseMiniProgramCssBranch(branch) {
|
|
3013
|
+
return branch.platformFamily === "mini-program" || branch.platformFamily === "native-app";
|
|
3014
|
+
}
|
|
3015
|
+
function shouldUseNativeAppCssBranch(branch) {
|
|
3016
|
+
return branch.platformFamily === "native-app";
|
|
3017
|
+
}
|
|
3018
|
+
//#endregion
|
|
3019
|
+
//#region src/generator/options.ts
|
|
3020
|
+
function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
3021
|
+
const enabled = options !== false;
|
|
3022
|
+
const objectOptions = enabled ? options : void 0;
|
|
3023
|
+
const target = objectOptions?.target ?? (shouldUseUniAppViteWebViewGeneratorTarget(context.appType, context.platform) ? "web" : inferGeneratorTargetFromEnv());
|
|
3024
|
+
const branch = resolveRuntimeBranch({
|
|
3025
|
+
...context,
|
|
3026
|
+
generatorTarget: target
|
|
3027
|
+
});
|
|
3028
|
+
const hasExplicitTarget = objectOptions !== void 0 && Object.hasOwn(objectOptions, "target");
|
|
3029
|
+
const webCompat = objectOptions?.webCompat ?? (!hasExplicitTarget && branch.isWeb ? true : void 0);
|
|
3030
|
+
if (objectOptions == null) return {
|
|
3031
|
+
enabled,
|
|
3032
|
+
target,
|
|
3033
|
+
branch,
|
|
3034
|
+
webCompat,
|
|
3035
|
+
hmr: { preserveDeletedCss: true },
|
|
3036
|
+
importFallback: false,
|
|
3037
|
+
bareArbitraryValues: void 0
|
|
3038
|
+
};
|
|
3039
|
+
return {
|
|
3040
|
+
enabled,
|
|
3041
|
+
target,
|
|
3042
|
+
branch,
|
|
3043
|
+
config: objectOptions.config,
|
|
3044
|
+
styleOptions: objectOptions.styleOptions,
|
|
3045
|
+
webCompat,
|
|
3046
|
+
hmr: { preserveDeletedCss: objectOptions.hmr?.preserveDeletedCss ?? true },
|
|
3047
|
+
importFallback: objectOptions.importFallback ?? false,
|
|
3048
|
+
bareArbitraryValues: objectOptions.bareArbitraryValues
|
|
3049
|
+
};
|
|
3050
|
+
}
|
|
3051
|
+
//#endregion
|
|
3052
|
+
//#region src/generator/index.ts
|
|
3053
|
+
function createWeappTailwindcssGenerator(source) {
|
|
3054
|
+
return createTailwindV4Engine(source);
|
|
3055
|
+
}
|
|
3056
|
+
async function resolveTailwindSourceFromRuntime(tailwindRuntime) {
|
|
3057
|
+
return resolveTailwindV4SourceFromRuntime(tailwindRuntime);
|
|
3058
|
+
}
|
|
3059
|
+
async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
3060
|
+
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3061
|
+
}
|
|
3062
|
+
//#endregion
|
|
2887
3063
|
Object.defineProperty(exports, "FULL_SOURCE_SCAN_EXTENSION_RE", {
|
|
2888
3064
|
enumerable: true,
|
|
2889
3065
|
get: function() {
|
|
@@ -2932,6 +3108,18 @@ Object.defineProperty(exports, "createTailwindV4Engine", {
|
|
|
2932
3108
|
return createTailwindV4Engine;
|
|
2933
3109
|
}
|
|
2934
3110
|
});
|
|
3111
|
+
Object.defineProperty(exports, "createWeappTailwindcssGenerator", {
|
|
3112
|
+
enumerable: true,
|
|
3113
|
+
get: function() {
|
|
3114
|
+
return createWeappTailwindcssGenerator;
|
|
3115
|
+
}
|
|
3116
|
+
});
|
|
3117
|
+
Object.defineProperty(exports, "createWeappTailwindcssGeneratorFromRuntime", {
|
|
3118
|
+
enumerable: true,
|
|
3119
|
+
get: function() {
|
|
3120
|
+
return createWeappTailwindcssGeneratorFromRuntime;
|
|
3121
|
+
}
|
|
3122
|
+
});
|
|
2935
3123
|
Object.defineProperty(exports, "expandTailwindSourceEntries", {
|
|
2936
3124
|
enumerable: true,
|
|
2937
3125
|
get: function() {
|
|
@@ -3052,12 +3240,6 @@ Object.defineProperty(exports, "hasUserCssLayerBlocks", {
|
|
|
3052
3240
|
return hasUserCssLayerBlocks;
|
|
3053
3241
|
}
|
|
3054
3242
|
});
|
|
3055
|
-
Object.defineProperty(exports, "inferGeneratorTargetFromEnv", {
|
|
3056
|
-
enumerable: true,
|
|
3057
|
-
get: function() {
|
|
3058
|
-
return inferGeneratorTargetFromEnv;
|
|
3059
|
-
}
|
|
3060
|
-
});
|
|
3061
3243
|
Object.defineProperty(exports, "isCommentOnlyCss", {
|
|
3062
3244
|
enumerable: true,
|
|
3063
3245
|
get: function() {
|
|
@@ -3136,6 +3318,12 @@ Object.defineProperty(exports, "normalizeTailwindcssRuntimeOptions", {
|
|
|
3136
3318
|
return normalizeTailwindcssRuntimeOptions;
|
|
3137
3319
|
}
|
|
3138
3320
|
});
|
|
3321
|
+
Object.defineProperty(exports, "normalizeWeappTailwindcssGeneratorOptions", {
|
|
3322
|
+
enumerable: true,
|
|
3323
|
+
get: function() {
|
|
3324
|
+
return normalizeWeappTailwindcssGeneratorOptions;
|
|
3325
|
+
}
|
|
3326
|
+
});
|
|
3139
3327
|
Object.defineProperty(exports, "omitUndefined", {
|
|
3140
3328
|
enumerable: true,
|
|
3141
3329
|
get: function() {
|
|
@@ -3208,12 +3396,30 @@ Object.defineProperty(exports, "resolveCssSourceEntries", {
|
|
|
3208
3396
|
return resolveCssSourceEntries;
|
|
3209
3397
|
}
|
|
3210
3398
|
});
|
|
3399
|
+
Object.defineProperty(exports, "resolveGeneratorRuntimeBranch", {
|
|
3400
|
+
enumerable: true,
|
|
3401
|
+
get: function() {
|
|
3402
|
+
return resolveGeneratorRuntimeBranch;
|
|
3403
|
+
}
|
|
3404
|
+
});
|
|
3405
|
+
Object.defineProperty(exports, "resolveRuntimeBranch", {
|
|
3406
|
+
enumerable: true,
|
|
3407
|
+
get: function() {
|
|
3408
|
+
return resolveRuntimeBranch;
|
|
3409
|
+
}
|
|
3410
|
+
});
|
|
3211
3411
|
Object.defineProperty(exports, "resolveSourceScanPath", {
|
|
3212
3412
|
enumerable: true,
|
|
3213
3413
|
get: function() {
|
|
3214
3414
|
return resolveSourceScanPath;
|
|
3215
3415
|
}
|
|
3216
3416
|
});
|
|
3417
|
+
Object.defineProperty(exports, "resolveTailwindSourceFromRuntime", {
|
|
3418
|
+
enumerable: true,
|
|
3419
|
+
get: function() {
|
|
3420
|
+
return resolveTailwindSourceFromRuntime;
|
|
3421
|
+
}
|
|
3422
|
+
});
|
|
3217
3423
|
Object.defineProperty(exports, "resolveTailwindV4CssSourceBase", {
|
|
3218
3424
|
enumerable: true,
|
|
3219
3425
|
get: function() {
|
|
@@ -3256,10 +3462,16 @@ Object.defineProperty(exports, "shouldFilterApplyOnlyGeneratedCss", {
|
|
|
3256
3462
|
return shouldFilterApplyOnlyGeneratedCss;
|
|
3257
3463
|
}
|
|
3258
3464
|
});
|
|
3259
|
-
Object.defineProperty(exports, "
|
|
3465
|
+
Object.defineProperty(exports, "shouldUseMiniProgramCssBranch", {
|
|
3466
|
+
enumerable: true,
|
|
3467
|
+
get: function() {
|
|
3468
|
+
return shouldUseMiniProgramCssBranch;
|
|
3469
|
+
}
|
|
3470
|
+
});
|
|
3471
|
+
Object.defineProperty(exports, "shouldUseNativeAppCssBranch", {
|
|
3260
3472
|
enumerable: true,
|
|
3261
3473
|
get: function() {
|
|
3262
|
-
return
|
|
3474
|
+
return shouldUseNativeAppCssBranch;
|
|
3263
3475
|
}
|
|
3264
3476
|
});
|
|
3265
3477
|
Object.defineProperty(exports, "splitGeneratorPlaceholderCssBySourceOrder", {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as transformCssMacroCss, o as transformCssMacroTailwindV4Source, r as hasCssMacroTailwindV4Source, s as withCssMacroStyleOptions, t as hasCssMacroStyleOptions } from "./auto-CrJJc5rK.mjs";
|
|
2
|
+
import { o as resolveUniUtsPlatform } from "./utils-DodxWHGz.mjs";
|
|
2
3
|
import { createRequire } from "node:module";
|
|
3
4
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
4
5
|
import path from "node:path";
|
|
@@ -440,6 +441,8 @@ function createTailwindV4DefaultColorThemeCss() {
|
|
|
440
441
|
}
|
|
441
442
|
//#endregion
|
|
442
443
|
//#region src/tailwindcss/v4-engine/generator/css-compat.ts
|
|
444
|
+
const require$1 = createRequire(import.meta.url);
|
|
445
|
+
const tailwindThemeCssCache = /* @__PURE__ */ new Map();
|
|
443
446
|
function findLeadingImportInsertionIndex(css) {
|
|
444
447
|
const importPattern = /(?:^|\n)\s*@import\b[^;]*;/g;
|
|
445
448
|
let insertionIndex = 0;
|
|
@@ -450,8 +453,46 @@ function findLeadingImportInsertionIndex(css) {
|
|
|
450
453
|
}
|
|
451
454
|
return insertionIndex;
|
|
452
455
|
}
|
|
453
|
-
function
|
|
454
|
-
const
|
|
456
|
+
function readCachedCss(file) {
|
|
457
|
+
const cached = tailwindThemeCssCache.get(file);
|
|
458
|
+
if (cached !== void 0) return cached;
|
|
459
|
+
const css = readFileSync(file, "utf8");
|
|
460
|
+
tailwindThemeCssCache.set(file, css);
|
|
461
|
+
return css;
|
|
462
|
+
}
|
|
463
|
+
function resolveTailwindV4ThemeCssFromImport(css) {
|
|
464
|
+
const root = postcss.parse(css);
|
|
465
|
+
let resolved;
|
|
466
|
+
root.walkAtRules("import", (rule) => {
|
|
467
|
+
if (resolved) return;
|
|
468
|
+
const specifier = parseCssImportSpecifier$2(rule.params);
|
|
469
|
+
if (!specifier || !path.isAbsolute(specifier) || path.basename(specifier) !== "index.css") return;
|
|
470
|
+
const themeCss = path.join(path.dirname(specifier), "theme.css");
|
|
471
|
+
if (existsSync(themeCss)) resolved = themeCss;
|
|
472
|
+
});
|
|
473
|
+
return resolved;
|
|
474
|
+
}
|
|
475
|
+
function resolveTailwindV4ThemeCssFromBase(base) {
|
|
476
|
+
try {
|
|
477
|
+
return createRequire(path.join(base, "package.json")).resolve("tailwindcss/theme.css");
|
|
478
|
+
} catch {
|
|
479
|
+
try {
|
|
480
|
+
return require$1.resolve("tailwindcss/theme.css");
|
|
481
|
+
} catch {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
function resolveTailwindV4DefaultThemeCss(source) {
|
|
487
|
+
try {
|
|
488
|
+
const themeCss = resolveTailwindV4ThemeCssFromImport(source.css) ?? resolveTailwindV4ThemeCssFromBase(source.base);
|
|
489
|
+
return themeCss ? readCachedCss(themeCss) : createTailwindV4DefaultColorThemeCss();
|
|
490
|
+
} catch {
|
|
491
|
+
return createTailwindV4DefaultColorThemeCss();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function applyMiniProgramTailwindV4DefaultColorCss(css, source) {
|
|
495
|
+
const themeCss = resolveTailwindV4DefaultThemeCss(source);
|
|
455
496
|
const insertionIndex = findLeadingImportInsertionIndex(css);
|
|
456
497
|
if (insertionIndex === 0) return `${themeCss}\n${css}`;
|
|
457
498
|
return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
|
|
@@ -514,7 +555,7 @@ function removeUnsupportedThemeVendorKeyframes(css) {
|
|
|
514
555
|
}
|
|
515
556
|
function createCompatibleSource(source, target) {
|
|
516
557
|
const filteredSourceCss = target === "weapp" ? removeTailwindV4PreflightImports(source.css) : source.css;
|
|
517
|
-
const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss) : filteredSourceCss);
|
|
558
|
+
const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss, source) : filteredSourceCss);
|
|
518
559
|
return compatibleSourceCss === source.css ? source : {
|
|
519
560
|
...source,
|
|
520
561
|
css: compatibleSourceCss
|
|
@@ -1105,8 +1146,8 @@ async function transformTailwindV4CssByTarget(css, target, options) {
|
|
|
1105
1146
|
//#region src/tailwindcss/v4-engine/generator.ts
|
|
1106
1147
|
const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
1107
1148
|
const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
1108
|
-
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX =
|
|
1109
|
-
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX =
|
|
1149
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12e3;
|
|
1150
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 2 * 1024 * 1024;
|
|
1110
1151
|
const incrementalGenerateCache = new LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX });
|
|
1111
1152
|
const incrementalGenerateTaskCache = new LRUCache({ max: INCREMENTAL_GENERATE_TASK_CACHE_MAX });
|
|
1112
1153
|
function collectCandidates(candidates) {
|
|
@@ -1251,6 +1292,9 @@ function normalizeTargetRpxLengthCandidates(candidates, target, styleOptions) {
|
|
|
1251
1292
|
restoreCandidates: /* @__PURE__ */ new Map()
|
|
1252
1293
|
};
|
|
1253
1294
|
}
|
|
1295
|
+
function resolveGeneratedSourcePatterns(generatedSources, scanSources) {
|
|
1296
|
+
return Array.isArray(scanSources) ? scanSources : generatedSources;
|
|
1297
|
+
}
|
|
1254
1298
|
function createTailwindV4Engine$1(source) {
|
|
1255
1299
|
async function generateOnce(generateSource, options = {}) {
|
|
1256
1300
|
const { scanSources = true, styleOptions, target = "weapp", ...patchOptions } = options;
|
|
@@ -1265,10 +1309,12 @@ function createTailwindV4Engine$1(source) {
|
|
|
1265
1309
|
...patchOptions,
|
|
1266
1310
|
candidates: normalizedCandidates.candidates
|
|
1267
1311
|
}));
|
|
1312
|
+
const sources = resolveGeneratedSourcePatterns(result.sources, resolvedScanSources);
|
|
1268
1313
|
const rawCss = restoreRpxLengthCssSelectors(result.css, normalizedCandidates.restoreCandidates);
|
|
1269
1314
|
const css = await transformTailwindV4CssByTarget(rawCss, target, resolvedStyleOptions);
|
|
1270
1315
|
return {
|
|
1271
1316
|
...result,
|
|
1317
|
+
sources,
|
|
1272
1318
|
classSet: restoreRpxLengthCandidates(result.classSet, normalizedCandidates.restoreCandidates),
|
|
1273
1319
|
rawCandidates: restoreRpxLengthCandidates(result.rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1274
1320
|
css,
|
|
@@ -1290,7 +1336,7 @@ function createTailwindV4Engine$1(source) {
|
|
|
1290
1336
|
compatibleSource,
|
|
1291
1337
|
generated,
|
|
1292
1338
|
requestedCandidates,
|
|
1293
|
-
styleOptions
|
|
1339
|
+
styleOptions,
|
|
1294
1340
|
target
|
|
1295
1341
|
})) incrementalGenerateCache.delete(cacheKey);
|
|
1296
1342
|
return generated;
|
|
@@ -2401,10 +2447,10 @@ function shouldFilterApplyOnlyGeneratedCss(_majorVersion, target, source, option
|
|
|
2401
2447
|
}
|
|
2402
2448
|
async function transformGeneratorUserCss(source, options) {
|
|
2403
2449
|
if (source.trim().length === 0) return "";
|
|
2404
|
-
if (options.processed) return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(removeProcessedMiniProgramUnsupportedCss(source, {
|
|
2450
|
+
if (options.processed) return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(unwrapMiniProgramCascadeLayers(removeProcessedMiniProgramUnsupportedCss(source, {
|
|
2405
2451
|
...options.generatorStyleOptions,
|
|
2406
2452
|
...options.cssUserHandlerOptions
|
|
2407
|
-
})) : source)));
|
|
2453
|
+
}))) : source)));
|
|
2408
2454
|
const cleanedSource = removeTailwindSourceDirectives(removeTailwindV4GeneratorAtRules(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(source))), { importFallback: options.importFallback });
|
|
2409
2455
|
if (cleanedSource.trim().length === 0) return "";
|
|
2410
2456
|
const userSource = stripUnmatchedTailwindSourceMediaCloseFragments(removeTailwindApplyAtRules(removeTailwindSourceDirectives(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(unwrapMiniProgramCascadeLayers(cleanedSource))) : cleanedSource)), { importFallback: options.importFallback })));
|
|
@@ -2879,4 +2925,134 @@ async function resolveTailwindV4SourceFromRuntime(runtime) {
|
|
|
2879
2925
|
return resolveTailwindV4Source$1(resolveTailwindV4SourceOptionsFromRuntime(runtime));
|
|
2880
2926
|
}
|
|
2881
2927
|
//#endregion
|
|
2882
|
-
|
|
2928
|
+
//#region src/runtime-branch/create-branch.ts
|
|
2929
|
+
function createRuntimeBranch(base, platformFamily, options) {
|
|
2930
|
+
const { context, tailwindcssVersion } = base;
|
|
2931
|
+
return {
|
|
2932
|
+
tailwindcssVersion,
|
|
2933
|
+
generatorTarget: context.generatorTarget,
|
|
2934
|
+
platformFamily,
|
|
2935
|
+
platform: options.platform,
|
|
2936
|
+
nativeAppPlatform: options.nativeAppPlatform,
|
|
2937
|
+
isTailwindV4: tailwindcssVersion === 4,
|
|
2938
|
+
isWeb: platformFamily === "web",
|
|
2939
|
+
isMiniProgram: platformFamily === "mini-program",
|
|
2940
|
+
isNativeApp: platformFamily === "native-app"
|
|
2941
|
+
};
|
|
2942
|
+
}
|
|
2943
|
+
//#endregion
|
|
2944
|
+
//#region src/runtime-branch/mini-program.ts
|
|
2945
|
+
function createMiniProgramRuntimeBranch(base) {
|
|
2946
|
+
const { context, uniUtsPlatform } = base;
|
|
2947
|
+
return createRuntimeBranch(base, "mini-program", { platform: typeof context.platform === "string" && context.platform.length > 0 ? context.platform : uniUtsPlatform.isMp ? uniUtsPlatform.normalized : context.platform });
|
|
2948
|
+
}
|
|
2949
|
+
//#endregion
|
|
2950
|
+
//#region src/runtime-branch/platform.ts
|
|
2951
|
+
function isRuntimeUniAppXEnabled(value) {
|
|
2952
|
+
return value === true || typeof value === "object" && value?.enabled !== false;
|
|
2953
|
+
}
|
|
2954
|
+
function normalizeRuntimeUniUtsPlatform(value) {
|
|
2955
|
+
return typeof value === "object" && value !== null ? value : resolveUniUtsPlatform(value);
|
|
2956
|
+
}
|
|
2957
|
+
function resolveNativeAppPlatform(platform) {
|
|
2958
|
+
if (platform.isAppAndroid) return "android";
|
|
2959
|
+
if (platform.isAppIos) return "ios";
|
|
2960
|
+
if (platform.isAppHarmony) return "harmony";
|
|
2961
|
+
return "unknown";
|
|
2962
|
+
}
|
|
2963
|
+
function resolveExplicitOrEnvPlatform(context, uniUtsPlatform) {
|
|
2964
|
+
if (typeof context.platform === "string" && context.platform.length > 0) return context.platform;
|
|
2965
|
+
return uniUtsPlatform.normalized;
|
|
2966
|
+
}
|
|
2967
|
+
//#endregion
|
|
2968
|
+
//#region src/runtime-branch/native-app.ts
|
|
2969
|
+
function createNativeAppRuntimeBranch(base) {
|
|
2970
|
+
return createRuntimeBranch(base, "native-app", {
|
|
2971
|
+
platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform),
|
|
2972
|
+
nativeAppPlatform: resolveNativeAppPlatform(base.uniUtsPlatform)
|
|
2973
|
+
});
|
|
2974
|
+
}
|
|
2975
|
+
//#endregion
|
|
2976
|
+
//#region src/runtime-branch/tailwind-version.ts
|
|
2977
|
+
function resolveTailwindcssBranchVersion(_majorVersion) {
|
|
2978
|
+
return 4;
|
|
2979
|
+
}
|
|
2980
|
+
//#endregion
|
|
2981
|
+
//#region src/runtime-branch/web.ts
|
|
2982
|
+
function createWebRuntimeBranch(base) {
|
|
2983
|
+
return createRuntimeBranch(base, "web", { platform: resolveExplicitOrEnvPlatform(base.context, base.uniUtsPlatform) });
|
|
2984
|
+
}
|
|
2985
|
+
//#endregion
|
|
2986
|
+
//#region src/runtime-branch/index.ts
|
|
2987
|
+
function shouldUseNativeAppBranch(base, uniUtsPlatform) {
|
|
2988
|
+
return base.appType === "uni-app-x" && isRuntimeUniAppXEnabled(base.uniAppX) && uniUtsPlatform.isApp;
|
|
2989
|
+
}
|
|
2990
|
+
function resolveRuntimeBranch(context) {
|
|
2991
|
+
const uniUtsPlatform = normalizeRuntimeUniUtsPlatform(context.uniUtsPlatform);
|
|
2992
|
+
const base = {
|
|
2993
|
+
context,
|
|
2994
|
+
tailwindcssVersion: resolveTailwindcssBranchVersion(context.tailwindcssMajorVersion),
|
|
2995
|
+
uniUtsPlatform
|
|
2996
|
+
};
|
|
2997
|
+
if (context.generatorTarget === "web") return createWebRuntimeBranch(base);
|
|
2998
|
+
if (shouldUseNativeAppBranch(context, uniUtsPlatform)) return createNativeAppRuntimeBranch(base);
|
|
2999
|
+
return createMiniProgramRuntimeBranch(base);
|
|
3000
|
+
}
|
|
3001
|
+
function resolveGeneratorRuntimeBranch(options, context = {}) {
|
|
3002
|
+
return options.branch ?? resolveRuntimeBranch({
|
|
3003
|
+
...context,
|
|
3004
|
+
generatorTarget: options.target
|
|
3005
|
+
});
|
|
3006
|
+
}
|
|
3007
|
+
function shouldUseMiniProgramCssBranch(branch) {
|
|
3008
|
+
return branch.platformFamily === "mini-program" || branch.platformFamily === "native-app";
|
|
3009
|
+
}
|
|
3010
|
+
function shouldUseNativeAppCssBranch(branch) {
|
|
3011
|
+
return branch.platformFamily === "native-app";
|
|
3012
|
+
}
|
|
3013
|
+
//#endregion
|
|
3014
|
+
//#region src/generator/options.ts
|
|
3015
|
+
function normalizeWeappTailwindcssGeneratorOptions(options, context = {}) {
|
|
3016
|
+
const enabled = options !== false;
|
|
3017
|
+
const objectOptions = enabled ? options : void 0;
|
|
3018
|
+
const target = objectOptions?.target ?? (shouldUseUniAppViteWebViewGeneratorTarget(context.appType, context.platform) ? "web" : inferGeneratorTargetFromEnv());
|
|
3019
|
+
const branch = resolveRuntimeBranch({
|
|
3020
|
+
...context,
|
|
3021
|
+
generatorTarget: target
|
|
3022
|
+
});
|
|
3023
|
+
const hasExplicitTarget = objectOptions !== void 0 && Object.hasOwn(objectOptions, "target");
|
|
3024
|
+
const webCompat = objectOptions?.webCompat ?? (!hasExplicitTarget && branch.isWeb ? true : void 0);
|
|
3025
|
+
if (objectOptions == null) return {
|
|
3026
|
+
enabled,
|
|
3027
|
+
target,
|
|
3028
|
+
branch,
|
|
3029
|
+
webCompat,
|
|
3030
|
+
hmr: { preserveDeletedCss: true },
|
|
3031
|
+
importFallback: false,
|
|
3032
|
+
bareArbitraryValues: void 0
|
|
3033
|
+
};
|
|
3034
|
+
return {
|
|
3035
|
+
enabled,
|
|
3036
|
+
target,
|
|
3037
|
+
branch,
|
|
3038
|
+
config: objectOptions.config,
|
|
3039
|
+
styleOptions: objectOptions.styleOptions,
|
|
3040
|
+
webCompat,
|
|
3041
|
+
hmr: { preserveDeletedCss: objectOptions.hmr?.preserveDeletedCss ?? true },
|
|
3042
|
+
importFallback: objectOptions.importFallback ?? false,
|
|
3043
|
+
bareArbitraryValues: objectOptions.bareArbitraryValues
|
|
3044
|
+
};
|
|
3045
|
+
}
|
|
3046
|
+
//#endregion
|
|
3047
|
+
//#region src/generator/index.ts
|
|
3048
|
+
function createWeappTailwindcssGenerator(source) {
|
|
3049
|
+
return createTailwindV4Engine$1(source);
|
|
3050
|
+
}
|
|
3051
|
+
async function resolveTailwindSourceFromRuntime(tailwindRuntime) {
|
|
3052
|
+
return resolveTailwindV4SourceFromRuntime(tailwindRuntime);
|
|
3053
|
+
}
|
|
3054
|
+
async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
3055
|
+
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
3056
|
+
}
|
|
3057
|
+
//#endregion
|
|
3058
|
+
export { normalizeTailwindSourceForGenerator as $, hasUserCssLayerBlocks as A, toPosixPath as At, transformGeneratorUserCss as B, normalizeExtendLengthUnits as C, expandTailwindSourceEntries as Ct, resolveBooleanObjectOption as D, resolveCssSourceEntries as Dt, normalizeStringListOption as E, parseConfigParam as Et, removeTailwindV4GeneratorAtRules as F, loadTailwindV4DesignSystem as Ft, stripMiniProgramCssSpecificityPlaceholders as G, hasMiniProgramCssSpecificityPlaceholders as H, shouldFilterApplyOnlyGeneratedCss as I, resolveValidTailwindV4Candidates$1 as It, hasTailwindNonRootGenerationDirectives as J, hasLocalCssImport as K, splitUserCssLayerBlocks as L, normalizeEmptyTailwindCustomVariants as M, resolveCssMacroTailwindV4Source as Mt, removeMiniProgramHoverSelectors as N, filterUnsupportedMiniProgramTailwindV4Candidates as Nt, extractGeneratedCssForUserLayerSelectors as O, resolveSourceScanPath as Ot, removeTailwindV4GeneratedUserCssArtifacts as P, omitUndefined as Pt, normalizeTailwindSourceDirectives as Q, stripTailwindSourceMediaFragments as R, findWorkspaceRoot as S, createTailwindSourceEntryMatcher as St, resolveTailwindcssOptions as T, normalizeLegacyContentEntries as Tt, pruneMiniProgramGeneratedCss as U, finalizeMiniProgramCss as V, removeUnsupportedMiniProgramAtRules as W, hasTailwindSourceDirectives as X, hasTailwindRootDirectives as Y, normalizeTailwindConfigDirectives as Z, guessBasedirFromEntries as _, getTailwindV4IncrementalGenerateCacheStats as _t, resolveGeneratorRuntimeBranch as a, createCssAppend as at, findNearestPackageRoot as b, FULL_SOURCE_SCAN_EXTENSION_RE as bt, shouldUseNativeAppCssBranch as c, splitGeneratorPlaceholderCssBySourceOrder as ct, resolveTailwindV4SourceFromRuntimeOptions as d, stripGeneratorPlaceholderMarkers as dt, parseImportRequest as et, resolveTailwindV4SourceOptionsFromRuntime as f, stripTailwindBanner as ft, groupCssEntriesByBase as g, createTailwindV4Engine$1 as gt, upsertTailwindV4CssSource as h, prependConfigDirective as ht, normalizeWeappTailwindcssGeneratorOptions as i, VITE_MARKER_RE as it, isCommentOnlyCss as j, collectCssInlineSourceCandidates as jt, filterApplyOnlyGeneratedCss as k, resolveTailwindV4CssSourceBase as kt, resolveTailwindV4Source$1 as l, splitTailwindGeneratedCssByBanner as lt, hasConfiguredTailwindV4CssRoots as m, normalizeConfigDirective as mt, createWeappTailwindcssGeneratorFromRuntime as n, resolveCssEntrySource as nt, resolveRuntimeBranch as o, hasTailwindGeneratedCss as ot, filterTailwindV4CssSourceRoots as p, stripTailwindBanners as pt, hasTailwindApplyDirective as q, resolveTailwindSourceFromRuntime as r, GENERATOR_PLACEHOLDER_MARKER_RE as rt, shouldUseMiniProgramCssBranch as s, hasTailwindGeneratedCssMarkers as st, createWeappTailwindcssGenerator as t, removeTailwindSourceDirectives as tt, resolveTailwindV4SourceFromRuntime as u, splitTailwindV4GeneratedCssBySourceOrder as ut, isTailwindV4CssEntry as v, transformTailwindV4CssByTarget as vt, normalizeTailwindcssRuntimeOptions as w, isFileMatchedByTailwindSourceEntries as wt, findWorkspacePackageDir as x, FULL_SOURCE_SCAN_PATTERN as xt, normalizeCssEntries as y, transformTailwindV4CssToWeapp as yt, stripUnmatchedTailwindSourceMediaCloseFragments as z };
|
package/dist/generator.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const require_generator = require("./generator-DaaFxR5V.js");
|
|
2
|
+
const require_generator = require("./generator-Bz94KTkH.js");
|
|
4
3
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
5
4
|
exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
|
|
6
5
|
exports.normalizeWeappTailwindcssGeneratorOptions = require_generator.normalizeWeappTailwindcssGeneratorOptions;
|
|
7
6
|
exports.resolveTailwindSourceFromRuntime = require_generator.resolveTailwindSourceFromRuntime;
|
|
8
|
-
exports.resolveTailwindV4Source =
|
|
9
|
-
exports.resolveTailwindV4SourceFromRuntime =
|
|
10
|
-
exports.resolveTailwindV4SourceFromRuntimeOptions =
|
|
11
|
-
exports.resolveTailwindV4SourceOptionsFromRuntime =
|
|
12
|
-
exports.transformTailwindV4CssByTarget =
|
|
13
|
-
exports.transformTailwindV4CssToWeapp =
|
|
7
|
+
exports.resolveTailwindV4Source = require_generator.resolveTailwindV4Source;
|
|
8
|
+
exports.resolveTailwindV4SourceFromRuntime = require_generator.resolveTailwindV4SourceFromRuntime;
|
|
9
|
+
exports.resolveTailwindV4SourceFromRuntimeOptions = require_generator.resolveTailwindV4SourceFromRuntimeOptions;
|
|
10
|
+
exports.resolveTailwindV4SourceOptionsFromRuntime = require_generator.resolveTailwindV4SourceOptionsFromRuntime;
|
|
11
|
+
exports.transformTailwindV4CssByTarget = require_generator.transformTailwindV4CssByTarget;
|
|
12
|
+
exports.transformTailwindV4CssToWeapp = require_generator.transformTailwindV4CssToWeapp;
|
package/dist/generator.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator } from "./generator-DugIHBgl.mjs";
|
|
1
|
+
import { d as resolveTailwindV4SourceFromRuntimeOptions, f as resolveTailwindV4SourceOptionsFromRuntime, i as normalizeWeappTailwindcssGeneratorOptions, l as resolveTailwindV4Source, n as createWeappTailwindcssGeneratorFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4SourceFromRuntime, vt as transformTailwindV4CssByTarget, yt as transformTailwindV4CssToWeapp } from "./generator-ROzBodj6.mjs";
|
|
3
2
|
export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
|