weapp-tailwindcss 5.2.5 → 5.2.7
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/final-css-cleanup.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +11 -4
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +8 -0
- package/dist/bundlers/vite/hot-css-modules.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +0 -1
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-tailwind-root-css.d.ts +19 -0
- package/dist/{gulp-Nhszi1kK.cjs → gulp-Bun9iCRE.cjs} +5 -5
- package/dist/{gulp-DSi73qr-.js → gulp-BydhuCbr.js} +4 -4
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-Cye_A4mI.cjs → hmr-timing-D607CWrq.cjs} +1 -1
- package/dist/{hmr-timing-WgN_3dIC.js → hmr-timing-Gs9P-QtZ.js} +120 -5
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/{pipeline-helpers-DMO0otI8.cjs → pipeline-helpers-BLpoT8fX.cjs} +2 -2
- package/dist/rspack.cjs +1 -1
- package/dist/rspack.js +1 -1
- package/dist/{source-candidate-scan-signature-D4X_VprL.cjs → source-candidate-scan-signature-BGDNJE2r.cjs} +1 -1
- package/dist/{source-candidate-scan-signature-ZozKGBbH.js → source-candidate-scan-signature-CdjPWQqv.js} +1 -1
- package/dist/{v4-generation-core-CDI6ChiH.cjs → v4-generation-core-BrkM1vCs.cjs} +130 -3
- package/dist/{vite-Dafw4jK-.js → vite-DM-U-Ins.js} +129 -130
- package/dist/{vite-AB_sUPv9.cjs → vite-n0mRgEcF.cjs} +130 -131
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +2 -2
- package/dist/{webpack-B2ojv_HI.cjs → webpack-Bf8yJwTO.cjs} +4 -4
- package/dist/{webpack-Rx3u2_2x.js → webpack-BlUJf8Ru.js} +3 -3
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +1 -1
- package/dist/bundlers/vite/processed-css-assets/empty-at-rule.d.ts +0 -1
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
interface TailwindV4ApplyReferenceSourceOptions {
|
|
2
|
+
cssEntries?: string[] | undefined;
|
|
3
|
+
cssSources?: Array<{
|
|
4
|
+
css?: string | undefined;
|
|
5
|
+
file?: string | undefined;
|
|
6
|
+
}> | undefined;
|
|
7
|
+
packageName?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare function createTailwindV4ApplyReferenceSource(css: string, sourceOptions: TailwindV4ApplyReferenceSourceOptions): string;
|
|
4
10
|
export declare function createTailwindV4SourceReferenceSource(css: string, sourceOptions: {
|
|
5
11
|
packageName?: string;
|
|
6
|
-
}): string;
|
|
12
|
+
}, referenceDirective?: string): string;
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
2
|
import type { GenerateBundleContext } from './types.js';
|
|
3
3
|
import type { IStyleHandlerOptions } from '../../../types/index.js';
|
|
4
|
+
export declare function finalizeMiniProgramCssAssetStructures(bundle: Record<string, OutputAsset | OutputChunk>, options: {
|
|
5
|
+
cssMatcher: GenerateBundleContext['opts']['cssMatcher'];
|
|
6
|
+
files?: ReadonlySet<string> | undefined;
|
|
7
|
+
isWebGeneratorTarget: boolean;
|
|
8
|
+
onUpdate: GenerateBundleContext['opts']['onUpdate'];
|
|
9
|
+
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
|
|
10
|
+
debug?: GenerateBundleContext['debug'];
|
|
11
|
+
}): number;
|
|
4
12
|
export declare function finalizeMiniProgramCssAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: {
|
|
5
13
|
cssMatcher: GenerateBundleContext['opts']['cssMatcher'];
|
|
6
14
|
getCssHandlerOptions: (file: string) => IStyleHandlerOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HmrContext, ModuleNode } from 'vite';
|
|
2
|
-
export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds:
|
|
2
|
+
export declare function resolveHotTailwindCssModules(ctx: HmrContext, tailwindRootCssModuleIds: Iterable<string | null | undefined>): ModuleNode[];
|
|
3
3
|
export declare function resolveHotSourceModules(ctx: HmrContext): ModuleNode[];
|
|
4
4
|
export declare function hasSelfAcceptingNonStyleHotModule(modules: ModuleNode[]): boolean;
|
|
5
5
|
export declare function sendSupplementalCssHotUpdates(ctx: HmrContext, cssModules: ModuleNode[], fallbackCssIds?: Iterable<string>): void;
|
|
@@ -2,7 +2,6 @@ import type { OutputAsset, OutputBundle } from 'rollup';
|
|
|
2
2
|
import type { CollectViteProcessedCssAssetOptions } from './markers-imports.js';
|
|
3
3
|
export declare function restoreCssImportAtRules(source: string, filtered: string, file?: string): string;
|
|
4
4
|
export declare function removeCommentOnlyAtRules(css: string): string;
|
|
5
|
-
export declare function removeEmptyCssAtRules(css: string): string;
|
|
6
5
|
export declare function collectImportedBundleCssSources(bundle: OutputBundle, importedStyleFiles: Set<string>): string[];
|
|
7
6
|
export declare function collectBundleAssetFiles(bundle: OutputBundle): Set<string>;
|
|
8
7
|
export declare function resolveConfiguredCssEntryRootInjectionTarget(bundle: OutputBundle, options: Pick<CollectViteProcessedCssAssetOptions, 'cssPipelineStrategy' | 'createCssPipelineContext' | 'opts'>, sourceFile: string | undefined, outputFile: string): string | undefined;
|
|
@@ -31,6 +31,7 @@ export interface CollectViteProcessedCssAssetOptions {
|
|
|
31
31
|
recordCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
32
32
|
recordViteProcessedCssAssetResult?: CssAssetResultRecorder | undefined;
|
|
33
33
|
resolveViteProcessedCssOutputFile?: ((file: string) => string | undefined) | undefined;
|
|
34
|
+
onAssetWrite?: ((file: string) => void) | undefined;
|
|
34
35
|
subpackageRoots?: Set<string> | undefined;
|
|
35
36
|
transformCss?: ((css: string, file: string) => string) | undefined;
|
|
36
37
|
debug?: ((format: string, ...args: unknown[]) => void) | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface FrameworkTailwindRootCssOptions {
|
|
2
|
+
getImportFallback: () => boolean;
|
|
3
|
+
refreshRuntimeState: (force: boolean) => Promise<void>;
|
|
4
|
+
registerAutoCssSource: (id: string, css: string) => Promise<void>;
|
|
5
|
+
shouldOwnTailwindGeneration: boolean;
|
|
6
|
+
sourceScanSession: {
|
|
7
|
+
invalidate: () => void;
|
|
8
|
+
sync: (options?: {
|
|
9
|
+
force?: boolean;
|
|
10
|
+
}) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function createFrameworkTailwindRootCss(options: FrameworkTailwindRootCssOptions): {
|
|
14
|
+
refreshSource: (id: string, code: string) => Promise<void>;
|
|
15
|
+
register: (id: string, code: string) => Promise<void>;
|
|
16
|
+
rememberModule: (id: unknown) => void;
|
|
17
|
+
moduleIds: Set<string>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
2
|
const require_generator = require("./generator-BE34PYSC.cjs");
|
|
3
3
|
const require_options = require("./options-hVsoTfwL.cjs");
|
|
4
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
4
|
+
const require_v4_generation_core = require("./v4-generation-core-BrkM1vCs.cjs");
|
|
5
5
|
const require_wxml = require("./wxml-DSMNuUaP.cjs");
|
|
6
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
6
|
+
const require_hmr_timing = require("./hmr-timing-D607CWrq.cjs");
|
|
7
7
|
const require_context = require("./context-OqD_eBxQ.cjs");
|
|
8
8
|
const require_tailwindcss = require("./tailwindcss-DcpiKvmJ.cjs");
|
|
9
9
|
const require_style_options = require("./style-options-B_ppaVIg.cjs");
|
|
@@ -261,7 +261,7 @@ function createGulpFileTransforms(context) {
|
|
|
261
261
|
const generatedCss = stage === "generate" && generated ? `${require_v4_generation_core.createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
|
|
262
262
|
const outputCss = stage === "generate" ? generatedCss : (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss, { styleOutputExtension });
|
|
263
263
|
debug("css handle: %s", file.path);
|
|
264
|
-
return { result: outputCss };
|
|
264
|
+
return { result: stage === "transform" ? require_v4_generation_core.finalizeMiniProgramCssStructure(outputCss) : outputCss };
|
|
265
265
|
}
|
|
266
266
|
});
|
|
267
267
|
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
@@ -279,11 +279,11 @@ function createGulpFileTransforms(context) {
|
|
|
279
279
|
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, source, options);
|
|
280
280
|
const handled = await styleHandler(source, cssHandlerOptions);
|
|
281
281
|
const preflightMode = generatedCssPreflightModeByFile.get(file.path);
|
|
282
|
-
writeGulpFileAsset(file, (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss ? require_v4_generation_core.finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
282
|
+
writeGulpFileAsset(file, require_v4_generation_core.finalizeMiniProgramCssStructure((0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss ? require_v4_generation_core.finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
283
283
|
injectPreflight: preflightMode?.inject ?? cssHandlerOptions.isMainChunk,
|
|
284
284
|
preservePreflight: preflightMode?.preserve ?? cssHandlerOptions.isMainChunk,
|
|
285
285
|
styleOptions: cssHandlerOptions
|
|
286
|
-
}) : handled.css, { styleOutputExtension }));
|
|
286
|
+
}) : handled.css, { styleOutputExtension })));
|
|
287
287
|
debug("css adapt: %s", file.path);
|
|
288
288
|
}, () => resolveGulpTransformTimingDetails("css:adapt"));
|
|
289
289
|
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pt as getTailwindV4IncrementalGenerateCacheStats, Q as hasTailwindRootDirectives, _ as upsertTailwindV4CssSource, et as normalizeTailwindConfigDirectives, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, nt as normalizeTailwindSourceForGenerator, vt as prependConfigDirective } from "./generator-DYeAa2-5.js";
|
|
2
2
|
import { l as getRuntimeClassSetSignature, p as resolveSourceScanEntries } from "./tailwindcss-CTpCc_nd.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as invalidateCompilationScope, A as createCssSourceTraceCacheSignature, B as finalizeCompilerShadowRun, C as createBundlerGeneratedCssMarker, D as finalizeMiniProgramCssStructure, E as stripBundlerGeneratedCssMarkers, J as disposeCompilerOwner, K as updateRuntimeCompilationBuildState, N as processCachedTask, P as createRuntimeClassSetManager, Q as getCompilationScopeDependencyRevision, R as rewriteLocalCssImportRequestsForOutput, U as createRuntimeCompilationBuildState, V as buildRuntimeCompilationSnapshot, W as removeRuntimeCompilationBuildStateFiles, X as getCompilerShadowRunSnapshot, Y as beginCompilerShadowRun, Z as AssetEmissionPlan, et as recordCompilationDependencyChanges, j as createCssTokenSourceMap, k as annotateCssSourceTrace, n as emitHmrTiming, nt as createSourceCandidateCollector, q as createRuntimeAffectingSourceSignature, r as generateTailwindV4Css, tt as createCompilationDependencyChanges, w as hasBundlerGeneratedCssMarker, y as finalizeMiniProgramGeneratorCss, z as splitLocalCssImports } from "./hmr-timing-Gs9P-QtZ.js";
|
|
4
4
|
import { h as createDebug } from "./wxml-IBzZSaQC.js";
|
|
5
5
|
import { l as createTailwindRuntimeReadyPromise, n as normalizeStyleHandlerMajorVersion, o as shouldSkipJsTransform, t as getCompilerContext, u as ensureRuntimeClassSet } from "./context-YAvTyPV2.js";
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -252,7 +252,7 @@ function createGulpFileTransforms(context) {
|
|
|
252
252
|
const generatedCss = stage === "generate" && generated ? `${createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
|
|
253
253
|
const outputCss = stage === "generate" ? generatedCss : rewriteLocalCssImportRequestsForOutput(generatedCss, { styleOutputExtension });
|
|
254
254
|
debug("css handle: %s", file.path);
|
|
255
|
-
return { result: outputCss };
|
|
255
|
+
return { result: stage === "transform" ? finalizeMiniProgramCssStructure(outputCss) : outputCss };
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
|
|
@@ -270,11 +270,11 @@ function createGulpFileTransforms(context) {
|
|
|
270
270
|
const cssHandlerOptions = resolveWxssFileHandlerOptions(file, source, options);
|
|
271
271
|
const handled = await styleHandler(source, cssHandlerOptions);
|
|
272
272
|
const preflightMode = generatedCssPreflightModeByFile.get(file.path);
|
|
273
|
-
writeGulpFileAsset(file, rewriteLocalCssImportRequestsForOutput(generatedCss ? finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
273
|
+
writeGulpFileAsset(file, finalizeMiniProgramCssStructure(rewriteLocalCssImportRequestsForOutput(generatedCss ? finalizeMiniProgramGeneratorCss(handled.css, "weapp", runtimeState.tailwindRuntime.majorVersion, opts.cssPreflight, {
|
|
274
274
|
injectPreflight: preflightMode?.inject ?? cssHandlerOptions.isMainChunk,
|
|
275
275
|
preservePreflight: preflightMode?.preserve ?? cssHandlerOptions.isMainChunk,
|
|
276
276
|
styleOptions: cssHandlerOptions
|
|
277
|
-
}) : handled.css, { styleOutputExtension }));
|
|
277
|
+
}) : handled.css, { styleOutputExtension })));
|
|
278
278
|
debug("css adapt: %s", file.path);
|
|
279
279
|
}, () => resolveGulpTransformTimingDetails("css:adapt"));
|
|
280
280
|
const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
|
package/dist/gulp.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_gulp = require("./gulp-
|
|
2
|
+
const require_gulp = require("./gulp-Bun9iCRE.cjs");
|
|
3
3
|
exports.WeappTailwindcss = require_gulp.createPlugins;
|
|
4
4
|
exports.createPlugins = require_gulp.createPlugins;
|
|
5
5
|
exports.weappTailwindcss = require_gulp.createPlugins;
|
package/dist/gulp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlugins } from "./gulp-
|
|
1
|
+
import { t as createPlugins } from "./gulp-BydhuCbr.js";
|
|
2
2
|
export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
2
|
const require_generator = require("./generator-BE34PYSC.cjs");
|
|
3
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
3
|
+
const require_v4_generation_core = require("./v4-generation-core-BrkM1vCs.cjs");
|
|
4
4
|
const require_wxml = require("./wxml-DSMNuUaP.cjs");
|
|
5
5
|
const require_tailwindcss = require("./tailwindcss-DcpiKvmJ.cjs");
|
|
6
6
|
let node_process = require("node:process");
|
|
@@ -8,7 +8,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import process from "node:process";
|
|
10
10
|
import { extractRawCandidatesWithPositions, extractSourceCandidates, extractValidCandidates, resolveProjectSourceFiles, resolveValidTailwindV4Candidates, splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
11
|
-
import { cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, filterExistingCssRules, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, normalizeMiniProgramGeneratedCssForPostcss, postcss, removeMatchingLocalCssImports, removeTailwindPostcssPlugins, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, splitLocalCssImports, splitLocalCssImportsRoot, transformWebCssCompat } from "@weapp-tailwindcss/postcss";
|
|
11
|
+
import { cleanLocalCssImportWrapperTailwindDirectives, cleanLocalCssImportWrapperTailwindDirectivesRoot, filterExistingCssRules, isPureLocalCssImportWrapper, isPureLocalCssImportWrapperRoot, normalizeMiniProgramGeneratedCssForPostcss, postcss, removeEmptyAtRules, removeMatchingLocalCssImports, removeTailwindPostcssPlugins, restoreLocalCssImports, rewriteLocalCssImportRequestsForOutput, splitLocalCssImports, splitLocalCssImportsRoot, transformWebCssCompat } from "@weapp-tailwindcss/postcss";
|
|
12
12
|
import { LRUCache } from "lru-cache";
|
|
13
13
|
import { readFile } from "node:fs/promises";
|
|
14
14
|
import { Parser } from "htmlparser2";
|
|
@@ -2440,6 +2440,104 @@ function annotateCssSourceTrace(css, options) {
|
|
|
2440
2440
|
}
|
|
2441
2441
|
}
|
|
2442
2442
|
//#endregion
|
|
2443
|
+
//#region src/bundlers/shared/final-css-cleanup.ts
|
|
2444
|
+
function isAtRuleNameCharacter(code) {
|
|
2445
|
+
return code === 45 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
2446
|
+
}
|
|
2447
|
+
function isCssWhitespace(code) {
|
|
2448
|
+
return code === 9 || code === 10 || code === 12 || code === 13 || code === 32;
|
|
2449
|
+
}
|
|
2450
|
+
function findAtRuleBlockStart(css, start) {
|
|
2451
|
+
let parenthesisDepth = 0;
|
|
2452
|
+
let quote = 0;
|
|
2453
|
+
let squareBracketDepth = 0;
|
|
2454
|
+
for (let index = start; index < css.length; index++) {
|
|
2455
|
+
const code = css.charCodeAt(index);
|
|
2456
|
+
if (quote !== 0) {
|
|
2457
|
+
if (code === 92) index++;
|
|
2458
|
+
else if (code === quote) quote = 0;
|
|
2459
|
+
continue;
|
|
2460
|
+
}
|
|
2461
|
+
if (code === 34 || code === 39) {
|
|
2462
|
+
quote = code;
|
|
2463
|
+
continue;
|
|
2464
|
+
}
|
|
2465
|
+
if (code === 92) {
|
|
2466
|
+
index++;
|
|
2467
|
+
continue;
|
|
2468
|
+
}
|
|
2469
|
+
if (code === 47 && css.charCodeAt(index + 1) === 42) {
|
|
2470
|
+
const commentEnd = css.indexOf("*/", index + 2);
|
|
2471
|
+
if (commentEnd < 0) return -1;
|
|
2472
|
+
index = commentEnd + 1;
|
|
2473
|
+
continue;
|
|
2474
|
+
}
|
|
2475
|
+
if (code === 40) {
|
|
2476
|
+
parenthesisDepth++;
|
|
2477
|
+
continue;
|
|
2478
|
+
}
|
|
2479
|
+
if (code === 41 && parenthesisDepth > 0) {
|
|
2480
|
+
parenthesisDepth--;
|
|
2481
|
+
continue;
|
|
2482
|
+
}
|
|
2483
|
+
if (code === 91) {
|
|
2484
|
+
squareBracketDepth++;
|
|
2485
|
+
continue;
|
|
2486
|
+
}
|
|
2487
|
+
if (code === 93 && squareBracketDepth > 0) {
|
|
2488
|
+
squareBracketDepth--;
|
|
2489
|
+
continue;
|
|
2490
|
+
}
|
|
2491
|
+
if (code === 123 && parenthesisDepth === 0 && squareBracketDepth === 0) return index;
|
|
2492
|
+
if ((code === 59 || code === 125) && parenthesisDepth === 0 && squareBracketDepth === 0) return -1;
|
|
2493
|
+
}
|
|
2494
|
+
return -1;
|
|
2495
|
+
}
|
|
2496
|
+
function isEmptyAtRuleBody(css, blockStart) {
|
|
2497
|
+
for (let index = blockStart + 1; index < css.length; index++) {
|
|
2498
|
+
const code = css.charCodeAt(index);
|
|
2499
|
+
if (isCssWhitespace(code)) continue;
|
|
2500
|
+
if (code === 47 && css.charCodeAt(index + 1) === 42) {
|
|
2501
|
+
const commentEnd = css.indexOf("*/", index + 2);
|
|
2502
|
+
if (commentEnd < 0) return false;
|
|
2503
|
+
index = commentEnd + 1;
|
|
2504
|
+
continue;
|
|
2505
|
+
}
|
|
2506
|
+
return code === 125;
|
|
2507
|
+
}
|
|
2508
|
+
return false;
|
|
2509
|
+
}
|
|
2510
|
+
function hasEmptyAtRuleBlockCandidate(css) {
|
|
2511
|
+
let searchFrom = 0;
|
|
2512
|
+
while (searchFrom < css.length) {
|
|
2513
|
+
const atRuleStart = css.indexOf("@", searchFrom);
|
|
2514
|
+
if (atRuleStart < 0) return false;
|
|
2515
|
+
searchFrom = atRuleStart + 1;
|
|
2516
|
+
if (!isAtRuleNameCharacter(css.charCodeAt(searchFrom))) continue;
|
|
2517
|
+
const blockStart = findAtRuleBlockStart(css, searchFrom + 1);
|
|
2518
|
+
if (blockStart >= 0 && isEmptyAtRuleBody(css, blockStart)) return true;
|
|
2519
|
+
}
|
|
2520
|
+
return false;
|
|
2521
|
+
}
|
|
2522
|
+
/**
|
|
2523
|
+
* 在小程序样式进入最终产物图时递归清理空的块级 at-rule。
|
|
2524
|
+
*/
|
|
2525
|
+
function finalizeMiniProgramCssStructure(css) {
|
|
2526
|
+
if (!hasEmptyAtRuleBlockCandidate(css)) return css;
|
|
2527
|
+
try {
|
|
2528
|
+
const root = postcss.parse(css);
|
|
2529
|
+
let removed = 0;
|
|
2530
|
+
let passRemoved = 0;
|
|
2531
|
+
do {
|
|
2532
|
+
passRemoved = removeEmptyAtRules(root);
|
|
2533
|
+
removed += passRemoved;
|
|
2534
|
+
} while (passRemoved > 0);
|
|
2535
|
+
return removed > 0 ? root.toString() : css;
|
|
2536
|
+
} catch {
|
|
2537
|
+
return css;
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
//#endregion
|
|
2443
2541
|
//#region src/bundlers/shared/generated-css-marker.ts
|
|
2444
2542
|
const BUNDLER_GENERATED_CSS_MARKER_RE = /\/\*!?\s*weapp-tailwindcss (?:gulp|vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/i;
|
|
2445
2543
|
const BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE = /\/\*!?\s*weapp-tailwindcss (?:gulp|vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/gi;
|
|
@@ -3498,16 +3596,33 @@ function collectGeneratorCssCandidates(css) {
|
|
|
3498
3596
|
}
|
|
3499
3597
|
//#endregion
|
|
3500
3598
|
//#region src/bundlers/shared/generator-css/source-resolver/apply-reference.ts
|
|
3599
|
+
function resolveTailwindV4ApplyReference(options) {
|
|
3600
|
+
const references = /* @__PURE__ */ new Set();
|
|
3601
|
+
for (const source of options.cssSources ?? []) if (typeof source.file === "string" && source.file.length > 0 && typeof source.css === "string" && hasTailwindRootDirectives(source.css, { importFallback: true }) && hasTailwindThemeDirective(source.css)) references.add(source.file);
|
|
3602
|
+
return references.size === 1 ? references.values().next().value : void 0;
|
|
3603
|
+
}
|
|
3604
|
+
function hasTailwindThemeDirective(css) {
|
|
3605
|
+
try {
|
|
3606
|
+
let found = false;
|
|
3607
|
+
postcss.parse(css).walkAtRules("theme", () => {
|
|
3608
|
+
found = true;
|
|
3609
|
+
});
|
|
3610
|
+
return found;
|
|
3611
|
+
} catch {
|
|
3612
|
+
return false;
|
|
3613
|
+
}
|
|
3614
|
+
}
|
|
3501
3615
|
function createTailwindV4ApplyReferenceSource(css, sourceOptions) {
|
|
3502
|
-
|
|
3616
|
+
const reference = resolveTailwindV4ApplyReference(sourceOptions);
|
|
3617
|
+
return createTailwindV4SourceReferenceSource(css, sourceOptions, reference ? `@reference ${JSON.stringify(reference.replace(/\\/g, "/"))};` : void 0);
|
|
3503
3618
|
}
|
|
3504
|
-
function createTailwindV4SourceReferenceSource(css, sourceOptions) {
|
|
3619
|
+
function createTailwindV4SourceReferenceSource(css, sourceOptions, referenceDirective) {
|
|
3505
3620
|
if (hasTailwindV4RootImport(css, sourceOptions)) return css;
|
|
3506
3621
|
const hasApplyDirective = hasTailwindApplyDirective(css);
|
|
3507
3622
|
if (!hasApplyDirective && !hasTailwindSourceDirectives(css, { importFallback: true })) return css;
|
|
3508
3623
|
const utilities = hasApplyDirective ? collectCssApplyCandidates(css) : [];
|
|
3509
3624
|
return [
|
|
3510
|
-
`@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);`,
|
|
3625
|
+
referenceDirective ?? `@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);`,
|
|
3511
3626
|
utilities.length > 0 ? `@source inline(${JSON.stringify(utilities.join(" "))});` : void 0,
|
|
3512
3627
|
css
|
|
3513
3628
|
].filter(Boolean).join("\n");
|
|
@@ -5654,4 +5769,4 @@ function createHmrTimingRecorder(bundler) {
|
|
|
5654
5769
|
};
|
|
5655
5770
|
}
|
|
5656
5771
|
//#endregion
|
|
5657
|
-
export {
|
|
5772
|
+
export { invalidateCompilationScope as $, createCssSourceTraceCacheSignature as A, finalizeCompilerShadowRun as B, createBundlerGeneratedCssMarker as C, finalizeMiniProgramCssStructure as D, stripBundlerGeneratedCssMarkers as E, collectStrictEscapedRuntimeCandidates as F, resetRuntimeCompilationBuildState as G, createRuntimeCompilationAffectingSignature as H, createEscapeFragments as I, disposeCompilerOwner as J, updateRuntimeCompilationBuildState as K, isPureLocalCssImportWrapper as L, isCssSourceTraceEnabled as M, processCachedTask as N, hasEmptyAtRuleBlockCandidate as O, createRuntimeClassSetManager as P, getCompilationScopeDependencyRevision as Q, rewriteLocalCssImportRequestsForOutput as R, stripRequestQuery as S, parseBundlerGeneratedCssMarkerBlocks as T, createRuntimeCompilationBuildState as U, buildRuntimeCompilationSnapshot as V, removeRuntimeCompilationBuildStateFiles as W, getCompilerShadowRunSnapshot as X, beginCompilerShadowRun as Y, AssetEmissionPlan as Z, collectFrameworkPostcssOptionsFromLoaderEntries as _, extractMarkedUserLayerComponentsCss as a, extractCandidatesFromSource as at, hasMiniProgramTailwindV4PreflightReset as b, pushConcurrentTaskFactories as c, normalizeMiniProgramGeneratorCssSource as d, recordCompilationDependencyChanges as et, normalizeMiniProgramImportShell as f, captureResolvedFrameworkPostcssOptions as g, captureFrameworkPostcssOptions as h, validateCandidatesByGenerator as i, isSourceCandidateRequest as it, createCssTokenSourceMap as j, annotateCssSourceTrace as k, resolveTaskConcurrency as l, removeGeneratedSelectorCompatCss as m, emitHmrTiming as n, createSourceCandidateCollector as nt, mergeMarkedUserLayerComponentsCss as o, resolveSourceCandidateScanFiles as ot, scoreTailwindV4CssSourceFileMatch as p, createRuntimeAffectingSourceSignature as q, generateTailwindV4Css as r, createSourceCandidateStore as rt, collectRawSourceClassSelectors as s, createHmrTimingRecorder as t, createCompilationDependencyChanges as tt, runWithConcurrency as u, createCssSourceOrderAppend as v, hasBundlerGeneratedCssMarker as w, isSourceStyleRequest as x, finalizeMiniProgramGeneratorCss as y, splitLocalCssImports as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_framework = require("./framework.cjs");
|
|
3
3
|
const require_generator = require("./generator-BE34PYSC.cjs");
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
4
|
+
const require_gulp = require("./gulp-Bun9iCRE.cjs");
|
|
5
5
|
const require_postcss = require("./postcss.cjs");
|
|
6
|
-
const require_vite = require("./vite-
|
|
7
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-n0mRgEcF.cjs");
|
|
7
|
+
const require_webpack = require("./webpack-Bf8yJwTO.cjs");
|
|
8
8
|
require("./webpack.cjs");
|
|
9
9
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
10
10
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
package/dist/index.js
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.js";
|
|
2
2
|
import { t as createWeappTailwindcssGenerator } from "./generator-DYeAa2-5.js";
|
|
3
|
-
import { t as createPlugins } from "./gulp-
|
|
3
|
+
import { t as createPlugins } from "./gulp-BydhuCbr.js";
|
|
4
4
|
import weappTailwindcssPostcssPlugin from "./postcss.js";
|
|
5
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
6
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-DM-U-Ins.js";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-BlUJf8Ru.js";
|
|
7
7
|
import "./webpack.js";
|
|
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 };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
2
2
|
const require_generator = require("./generator-BE34PYSC.cjs");
|
|
3
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
3
|
+
const require_v4_generation_core = require("./v4-generation-core-BrkM1vCs.cjs");
|
|
4
4
|
const require_defaults = require("./defaults.cjs");
|
|
5
5
|
const require_style_options = require("./style-options-B_ppaVIg.cjs");
|
|
6
6
|
let node_path = require("node:path");
|
|
@@ -517,7 +517,7 @@ function finalizeWebpackCssAssetSource(source, compilerOptions, isWebGeneratorTa
|
|
|
517
517
|
function finalizeWebpackCssAssetOutputSource(source, compilerOptions, isWebGeneratorTarget) {
|
|
518
518
|
if (isWebGeneratorTarget) return source;
|
|
519
519
|
const styleOptions = require_style_options.resolveStyleOptionsFromContext(compilerOptions);
|
|
520
|
-
return (0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(require_generator.removeMiniProgramHoverSelectors((0, _weapp_tailwindcss_postcss.dedupeCoveredCssRules)(dedupeMiniProgramPreflightSelectorRules(source)), styleOptions.cssRemoveHoverPseudoClass));
|
|
520
|
+
return require_v4_generation_core.finalizeMiniProgramCssStructure((0, _weapp_tailwindcss_postcss.stripMiniProgramCssSpecificityPlaceholders)(require_generator.removeMiniProgramHoverSelectors((0, _weapp_tailwindcss_postcss.dedupeCoveredCssRules)(dedupeMiniProgramPreflightSelectorRules(source)), styleOptions.cssRemoveHoverPseudoClass)));
|
|
521
521
|
}
|
|
522
522
|
function collectWebpackJsRuntimeCandidatesFromAssets(options) {
|
|
523
523
|
if (options.isWebGeneratorTarget) return;
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-CVvi-lCc.cjs");
|
|
3
|
-
const require_webpack = require("./webpack-
|
|
3
|
+
const require_webpack = require("./webpack-Bf8yJwTO.cjs");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
6
6
|
//#region src/bundlers/rspack/index.ts
|
package/dist/rspack.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-
|
|
1
|
+
import { n as weappTailwindcssPackageDir, r as __dirname, t as WeappTailwindcss } from "./webpack-BlUJf8Ru.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region src/bundlers/rspack/index.ts
|
|
4
4
|
const CSS_IMPORT_REWRITE_LOADER_NAME = "weapp-tw-css-import-rewrite-loader";
|
|
@@ -3,7 +3,7 @@ const require_framework = require("./framework.cjs");
|
|
|
3
3
|
const require_generator = require("./generator-BE34PYSC.cjs");
|
|
4
4
|
require("./auto-DtU6f3X6.cjs");
|
|
5
5
|
const require_options = require("./options-hVsoTfwL.cjs");
|
|
6
|
-
const require_v4_generation_core = require("./v4-generation-core-
|
|
6
|
+
const require_v4_generation_core = require("./v4-generation-core-BrkM1vCs.cjs");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -2,7 +2,7 @@ import { detectAppType } from "./framework.js";
|
|
|
2
2
|
import { At as toPosixPath } from "./generator-DYeAa2-5.js";
|
|
3
3
|
import { n as hasCssMacroTailwindV4CustomVariantConditionalComments } from "./auto-2dg_uhEJ.js";
|
|
4
4
|
import { _ as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions } from "./tailwindcss-CTpCc_nd.js";
|
|
5
|
-
import { x as isSourceStyleRequest } from "./hmr-timing-
|
|
5
|
+
import { x as isSourceStyleRequest } from "./hmr-timing-Gs9P-QtZ.js";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { weappStyleInjector } from "weapp-style-injector/vite";
|
|
@@ -2041,6 +2041,104 @@ function annotateCssSourceTrace(css, options) {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
2043
|
//#endregion
|
|
2044
|
+
//#region src/bundlers/shared/final-css-cleanup.ts
|
|
2045
|
+
function isAtRuleNameCharacter(code) {
|
|
2046
|
+
return code === 45 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
2047
|
+
}
|
|
2048
|
+
function isCssWhitespace(code) {
|
|
2049
|
+
return code === 9 || code === 10 || code === 12 || code === 13 || code === 32;
|
|
2050
|
+
}
|
|
2051
|
+
function findAtRuleBlockStart(css, start) {
|
|
2052
|
+
let parenthesisDepth = 0;
|
|
2053
|
+
let quote = 0;
|
|
2054
|
+
let squareBracketDepth = 0;
|
|
2055
|
+
for (let index = start; index < css.length; index++) {
|
|
2056
|
+
const code = css.charCodeAt(index);
|
|
2057
|
+
if (quote !== 0) {
|
|
2058
|
+
if (code === 92) index++;
|
|
2059
|
+
else if (code === quote) quote = 0;
|
|
2060
|
+
continue;
|
|
2061
|
+
}
|
|
2062
|
+
if (code === 34 || code === 39) {
|
|
2063
|
+
quote = code;
|
|
2064
|
+
continue;
|
|
2065
|
+
}
|
|
2066
|
+
if (code === 92) {
|
|
2067
|
+
index++;
|
|
2068
|
+
continue;
|
|
2069
|
+
}
|
|
2070
|
+
if (code === 47 && css.charCodeAt(index + 1) === 42) {
|
|
2071
|
+
const commentEnd = css.indexOf("*/", index + 2);
|
|
2072
|
+
if (commentEnd < 0) return -1;
|
|
2073
|
+
index = commentEnd + 1;
|
|
2074
|
+
continue;
|
|
2075
|
+
}
|
|
2076
|
+
if (code === 40) {
|
|
2077
|
+
parenthesisDepth++;
|
|
2078
|
+
continue;
|
|
2079
|
+
}
|
|
2080
|
+
if (code === 41 && parenthesisDepth > 0) {
|
|
2081
|
+
parenthesisDepth--;
|
|
2082
|
+
continue;
|
|
2083
|
+
}
|
|
2084
|
+
if (code === 91) {
|
|
2085
|
+
squareBracketDepth++;
|
|
2086
|
+
continue;
|
|
2087
|
+
}
|
|
2088
|
+
if (code === 93 && squareBracketDepth > 0) {
|
|
2089
|
+
squareBracketDepth--;
|
|
2090
|
+
continue;
|
|
2091
|
+
}
|
|
2092
|
+
if (code === 123 && parenthesisDepth === 0 && squareBracketDepth === 0) return index;
|
|
2093
|
+
if ((code === 59 || code === 125) && parenthesisDepth === 0 && squareBracketDepth === 0) return -1;
|
|
2094
|
+
}
|
|
2095
|
+
return -1;
|
|
2096
|
+
}
|
|
2097
|
+
function isEmptyAtRuleBody(css, blockStart) {
|
|
2098
|
+
for (let index = blockStart + 1; index < css.length; index++) {
|
|
2099
|
+
const code = css.charCodeAt(index);
|
|
2100
|
+
if (isCssWhitespace(code)) continue;
|
|
2101
|
+
if (code === 47 && css.charCodeAt(index + 1) === 42) {
|
|
2102
|
+
const commentEnd = css.indexOf("*/", index + 2);
|
|
2103
|
+
if (commentEnd < 0) return false;
|
|
2104
|
+
index = commentEnd + 1;
|
|
2105
|
+
continue;
|
|
2106
|
+
}
|
|
2107
|
+
return code === 125;
|
|
2108
|
+
}
|
|
2109
|
+
return false;
|
|
2110
|
+
}
|
|
2111
|
+
function hasEmptyAtRuleBlockCandidate(css) {
|
|
2112
|
+
let searchFrom = 0;
|
|
2113
|
+
while (searchFrom < css.length) {
|
|
2114
|
+
const atRuleStart = css.indexOf("@", searchFrom);
|
|
2115
|
+
if (atRuleStart < 0) return false;
|
|
2116
|
+
searchFrom = atRuleStart + 1;
|
|
2117
|
+
if (!isAtRuleNameCharacter(css.charCodeAt(searchFrom))) continue;
|
|
2118
|
+
const blockStart = findAtRuleBlockStart(css, searchFrom + 1);
|
|
2119
|
+
if (blockStart >= 0 && isEmptyAtRuleBody(css, blockStart)) return true;
|
|
2120
|
+
}
|
|
2121
|
+
return false;
|
|
2122
|
+
}
|
|
2123
|
+
/**
|
|
2124
|
+
* 在小程序样式进入最终产物图时递归清理空的块级 at-rule。
|
|
2125
|
+
*/
|
|
2126
|
+
function finalizeMiniProgramCssStructure(css) {
|
|
2127
|
+
if (!hasEmptyAtRuleBlockCandidate(css)) return css;
|
|
2128
|
+
try {
|
|
2129
|
+
const root = _weapp_tailwindcss_postcss.postcss.parse(css);
|
|
2130
|
+
let removed = 0;
|
|
2131
|
+
let passRemoved = 0;
|
|
2132
|
+
do {
|
|
2133
|
+
passRemoved = (0, _weapp_tailwindcss_postcss.removeEmptyAtRules)(root);
|
|
2134
|
+
removed += passRemoved;
|
|
2135
|
+
} while (passRemoved > 0);
|
|
2136
|
+
return removed > 0 ? root.toString() : css;
|
|
2137
|
+
} catch {
|
|
2138
|
+
return css;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
//#endregion
|
|
2044
2142
|
//#region src/bundlers/shared/generated-css-marker.ts
|
|
2045
2143
|
const BUNDLER_GENERATED_CSS_MARKER_RE = /\/\*!?\s*weapp-tailwindcss (?:gulp|vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/i;
|
|
2046
2144
|
const BUNDLER_GENERATED_CSS_MARKER_GLOBAL_RE = /\/\*!?\s*weapp-tailwindcss (?:gulp|vite|webpack)-generated-css(?:\s*:\s*[^\s*]+)?\s*\*\/\s*/gi;
|
|
@@ -3099,16 +3197,33 @@ function collectGeneratorCssCandidates(css) {
|
|
|
3099
3197
|
}
|
|
3100
3198
|
//#endregion
|
|
3101
3199
|
//#region src/bundlers/shared/generator-css/source-resolver/apply-reference.ts
|
|
3200
|
+
function resolveTailwindV4ApplyReference(options) {
|
|
3201
|
+
const references = /* @__PURE__ */ new Set();
|
|
3202
|
+
for (const source of options.cssSources ?? []) if (typeof source.file === "string" && source.file.length > 0 && typeof source.css === "string" && require_generator.hasTailwindRootDirectives(source.css, { importFallback: true }) && hasTailwindThemeDirective(source.css)) references.add(source.file);
|
|
3203
|
+
return references.size === 1 ? references.values().next().value : void 0;
|
|
3204
|
+
}
|
|
3205
|
+
function hasTailwindThemeDirective(css) {
|
|
3206
|
+
try {
|
|
3207
|
+
let found = false;
|
|
3208
|
+
_weapp_tailwindcss_postcss.postcss.parse(css).walkAtRules("theme", () => {
|
|
3209
|
+
found = true;
|
|
3210
|
+
});
|
|
3211
|
+
return found;
|
|
3212
|
+
} catch {
|
|
3213
|
+
return false;
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3102
3216
|
function createTailwindV4ApplyReferenceSource(css, sourceOptions) {
|
|
3103
|
-
|
|
3217
|
+
const reference = resolveTailwindV4ApplyReference(sourceOptions);
|
|
3218
|
+
return createTailwindV4SourceReferenceSource(css, sourceOptions, reference ? `@reference ${JSON.stringify(reference.replace(/\\/g, "/"))};` : void 0);
|
|
3104
3219
|
}
|
|
3105
|
-
function createTailwindV4SourceReferenceSource(css, sourceOptions) {
|
|
3220
|
+
function createTailwindV4SourceReferenceSource(css, sourceOptions, referenceDirective) {
|
|
3106
3221
|
if (hasTailwindV4RootImport(css, sourceOptions)) return css;
|
|
3107
3222
|
const hasApplyDirective = require_generator.hasTailwindApplyDirective(css);
|
|
3108
3223
|
if (!hasApplyDirective && !require_generator.hasTailwindSourceDirectives(css, { importFallback: true })) return css;
|
|
3109
3224
|
const utilities = hasApplyDirective ? collectCssApplyCandidates(css) : [];
|
|
3110
3225
|
return [
|
|
3111
|
-
`@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);`,
|
|
3226
|
+
referenceDirective ?? `@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);`,
|
|
3112
3227
|
utilities.length > 0 ? `@source inline(${JSON.stringify(utilities.join(" "))});` : void 0,
|
|
3113
3228
|
css
|
|
3114
3229
|
].filter(Boolean).join("\n");
|
|
@@ -5309,6 +5424,12 @@ Object.defineProperty(exports, "extractMarkedUserLayerComponentsCss", {
|
|
|
5309
5424
|
return extractMarkedUserLayerComponentsCss;
|
|
5310
5425
|
}
|
|
5311
5426
|
});
|
|
5427
|
+
Object.defineProperty(exports, "finalizeMiniProgramCssStructure", {
|
|
5428
|
+
enumerable: true,
|
|
5429
|
+
get: function() {
|
|
5430
|
+
return finalizeMiniProgramCssStructure;
|
|
5431
|
+
}
|
|
5432
|
+
});
|
|
5312
5433
|
Object.defineProperty(exports, "finalizeMiniProgramGeneratorCss", {
|
|
5313
5434
|
enumerable: true,
|
|
5314
5435
|
get: function() {
|
|
@@ -5339,6 +5460,12 @@ Object.defineProperty(exports, "hasBundlerGeneratedCssMarker", {
|
|
|
5339
5460
|
return hasBundlerGeneratedCssMarker;
|
|
5340
5461
|
}
|
|
5341
5462
|
});
|
|
5463
|
+
Object.defineProperty(exports, "hasEmptyAtRuleBlockCandidate", {
|
|
5464
|
+
enumerable: true,
|
|
5465
|
+
get: function() {
|
|
5466
|
+
return hasEmptyAtRuleBlockCandidate;
|
|
5467
|
+
}
|
|
5468
|
+
});
|
|
5342
5469
|
Object.defineProperty(exports, "hasMiniProgramTailwindV4PreflightReset", {
|
|
5343
5470
|
enumerable: true,
|
|
5344
5471
|
get: function() {
|