weapp-tailwindcss 5.5.9 → 5.5.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/vite/generate-bundle/css-cache-task.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-result.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +3 -3
- package/dist/bundlers/vite/generate-bundle/scoped-generator-runtime-cache.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator-sources.d.ts +36 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +6 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/source-trace.d.ts +2 -0
- package/dist/bundlers/vite/runtime-class-set/cache.d.ts +14 -0
- package/dist/bundlers/vite/runtime-class-set/invalidation-plugin.d.ts +6 -0
- package/dist/bundlers/vite/runtime-class-set/lifecycle.d.ts +12 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +1 -0
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +1 -2
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +1 -0
- package/dist/{scoped-generator-CF0ROe7B.js → css-cleanup-B3xP5Qph.js} +23 -20
- package/dist/{generated-css-marker-C21q8hGM.cjs → generated-css-marker-nqjR6ntO.cjs} +54 -6
- package/dist/{gulp-ComuY3KW.js → gulp-BCV0gOMb.js} +1 -1
- package/dist/{gulp-BhQhrDCx.cjs → gulp-DrX6QS3N.cjs} +2 -2
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-CXBDn0dl.cjs → hmr-timing-B56wp7y-.cjs} +1 -1
- package/dist/{hmr-timing-CNo2hmaX.js → hmr-timing-Bb54exB0.js} +54 -6
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/{pipeline-helpers-B9ZqLXma.cjs → pipeline-helpers-DJ3VZ01J.cjs} +1 -1
- package/dist/project-sources/candidates/view-memo.d.ts +7 -0
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.js +2 -2
- package/dist/{scoped-generator-BAiZDC_4.cjs → scoped-generator-DqNb8nJG.cjs} +28 -21
- package/dist/{transform-DJkkjruV.cjs → transform-CxVM0PfA.cjs} +1 -1
- package/dist/{transform-I-mzwoiv.js → transform-D0NXKPmD.js} +1 -1
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-BVcj7Ht9.cjs → vite-C3Zh6iYK.cjs} +421 -200
- package/dist/{vite-Bd-Ig5Dy.js → vite-D6_FxvdM.js} +421 -200
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/weapp-tw-css-generation-loader.cjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +2 -2
- package/dist/{web-Dq2PzKKQ.cjs → web-BzeWG_XO.cjs} +137 -73
- package/dist/{web-BsFZOq3g.js → web-K3qAX4sN.js} +137 -73
- package/dist/{webpack-DtAZoEth.js → webpack-BZBqKB4Y.js} +2 -2
- package/dist/{webpack-CWMoTWzF.cjs → webpack-Dbj2uykF.cjs} +4 -4
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +3 -3
|
@@ -3,6 +3,7 @@ import type { RememberedCssSource } from './types.js';
|
|
|
3
3
|
import type { ICreateCacheReturnType } from '../../../cache/index.js';
|
|
4
4
|
export interface ApplyViteCssCacheResultOptions {
|
|
5
5
|
applyCssResult: (source: string) => void;
|
|
6
|
+
recordCssResult?: ((source: string) => void) | undefined;
|
|
6
7
|
cssRuntimeAffectingHash: string;
|
|
7
8
|
generatorRawSource: string;
|
|
8
9
|
generatorSourceFile: string;
|
|
@@ -27,6 +27,7 @@ export declare function createMatchedCssSourceOutputResolver(options: {
|
|
|
27
27
|
assetSourceFile: string;
|
|
28
28
|
file: string;
|
|
29
29
|
originalFileNames?: string[] | undefined;
|
|
30
|
+
ownedSourceFiles?: string[] | undefined;
|
|
30
31
|
resolveOutputFileFromMatchedCssSource: (sourceFile: string | undefined) => string | undefined;
|
|
31
32
|
}): (sourceFile: string | undefined) => string | undefined;
|
|
32
33
|
export type ResolveCssAssetOutputPlanOptions = Parameters<typeof resolveCssBundleOutputFile>[0] & {
|
|
@@ -36,6 +37,7 @@ export type ResolveCssAssetOutputPlanOptions = Parameters<typeof resolveCssBundl
|
|
|
36
37
|
}>;
|
|
37
38
|
normalizeConfiguredSourceFile: (file: string) => string;
|
|
38
39
|
originalFileNames: string[] | undefined;
|
|
40
|
+
ownedSourceFiles?: string[] | undefined;
|
|
39
41
|
resolveOutputFileFromMatchedCssSource: (sourceFile: string | undefined) => string | undefined;
|
|
40
42
|
rootImportShellOutputFile: string;
|
|
41
43
|
rootImportShellTarget: string | undefined;
|
|
@@ -21,3 +21,4 @@ export interface ApplyViteCssTransformTaskResultOptions {
|
|
|
21
21
|
vitePipelineCssInjectionOutputFile: string;
|
|
22
22
|
}
|
|
23
23
|
export declare function applyViteCssTransformTaskResult(options: ApplyViteCssTransformTaskResultOptions): string;
|
|
24
|
+
export declare function recordViteCssContribution(options: Pick<ApplyViteCssTransformTaskResultOptions, 'file' | 'outputIsMainChunk' | 'recordViteProcessedCssAssetResult' | 'shouldRecordVitePipelineCssByOutput' | 'shouldInjectVitePipelineCssIntoMain' | 'vitePipelineCssAsset' | 'vitePipelineCssInjectionOutputFile'>, css: string): void;
|
|
@@ -10,13 +10,13 @@ interface ProcessRememberedCssReplayOptions {
|
|
|
10
10
|
changedCssFiles: Set<string>;
|
|
11
11
|
createScopedGeneratorRuntime: (outputFile: string, cssHandlerOptions: {
|
|
12
12
|
isMainChunk?: boolean | undefined;
|
|
13
|
-
}, runtime: Set<string>, rawSource?: string | undefined, sourceFile?: string | undefined) => Promise<Set<string>>;
|
|
13
|
+
}, runtime: Set<string>, rawSource?: string | undefined, sourceFile?: string | undefined, scopeToSource?: boolean | undefined) => Promise<Set<string>>;
|
|
14
14
|
createScopedSourceCandidateGetter: (outputFile: string, cssHandlerOptions: {
|
|
15
15
|
isMainChunk?: boolean | undefined;
|
|
16
|
-
}) => GenerateBundleContext['getSourceCandidatesForEntries'];
|
|
16
|
+
}, sourceFile?: string | undefined) => GenerateBundleContext['getSourceCandidatesForEntries'];
|
|
17
17
|
createScopedSourceCandidateSourceGetter: (outputFile: string, cssHandlerOptions: {
|
|
18
18
|
isMainChunk?: boolean | undefined;
|
|
19
|
-
}) => GenerateBundleContext['getSourceCandidateSourcesForEntries'];
|
|
19
|
+
}, sourceFile?: string | undefined) => GenerateBundleContext['getSourceCandidateSourcesForEntries'];
|
|
20
20
|
cssTaskFactories: Array<() => Promise<void>>;
|
|
21
21
|
cssPipelineContext: ViteFrameworkCssPipelineContext;
|
|
22
22
|
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type RuntimeResolver = (outputFile: string, options: {
|
|
2
|
+
isMainChunk?: boolean | undefined;
|
|
3
|
+
}, runtime: Set<string>, rawSource?: string, sourceFile?: string, scopeToSource?: boolean) => Promise<Set<string>>;
|
|
4
|
+
export declare function memoizeScopedGeneratorRuntime(resolve: RuntimeResolver): RuntimeResolver;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { createScopedGeneratorCandidateSignature } from './scoped-generator.js';
|
|
2
|
+
import type { RememberedCssSource } from './types.js';
|
|
3
|
+
interface GeneratorCssHandlerOptions {
|
|
4
|
+
isMainChunk?: boolean | undefined;
|
|
5
|
+
}
|
|
6
|
+
type SourceTraceResolver = (rawSource: string, sourceFile: string, options?: {
|
|
7
|
+
scopeToSource?: boolean;
|
|
8
|
+
}) => Promise<Map<string, Set<string>> | undefined>;
|
|
9
|
+
type RuntimeResolver = (outputFile: string, options: GeneratorCssHandlerOptions, runtime: Set<string>, rawSource?: string, sourceFile?: string, scopeToSource?: boolean) => Promise<Set<string>>;
|
|
10
|
+
type CandidateSignatureResolver = typeof createScopedGeneratorCandidateSignature;
|
|
11
|
+
type SignatureSource = Pick<RememberedCssSource, 'rawSource' | 'sourceFile'>;
|
|
12
|
+
export declare function hasScopedSourceDirectives(sources: readonly RememberedCssSource[]): boolean;
|
|
13
|
+
export declare function createScopedGeneratorSourceData(options: {
|
|
14
|
+
createScopedGeneratorRuntime: RuntimeResolver;
|
|
15
|
+
createScopedGeneratorSourceTraceMap: SourceTraceResolver;
|
|
16
|
+
generatorCssHandlerOptions: GeneratorCssHandlerOptions;
|
|
17
|
+
generatorRawSource: string;
|
|
18
|
+
generatorRuntime: Set<string>;
|
|
19
|
+
generatorSourceFile: string;
|
|
20
|
+
rememberedCssSources: RememberedCssSource[];
|
|
21
|
+
scopedSourceCandidateSourceGetter: ((entries: unknown) => Map<string, Set<string>>) | undefined;
|
|
22
|
+
outputFile: string;
|
|
23
|
+
}): Promise<{
|
|
24
|
+
scopedGeneratorRuntime: Set<string>;
|
|
25
|
+
signatureSources: SignatureSource[];
|
|
26
|
+
sourceTraceSources: Map<string, Set<string>> | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare function createScopedGeneratorCandidateSignatureForSources(options: {
|
|
29
|
+
createScopedGeneratorCandidateSignature: CandidateSignatureResolver;
|
|
30
|
+
generatorCssHandlerOptions: GeneratorCssHandlerOptions;
|
|
31
|
+
majorVersion: number | undefined;
|
|
32
|
+
scopedSourceCandidateGetter: Parameters<CandidateSignatureResolver>[3];
|
|
33
|
+
signatureSources: readonly SignatureSource[];
|
|
34
|
+
trackedGeneratorCandidateSignature: string;
|
|
35
|
+
}): Promise<string>;
|
|
36
|
+
export {};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { SourceCandidateFilterOptions } from '../source-candidates.js';
|
|
2
2
|
import type { TailwindSourceEntry } from '../../../tailwindcss/source-scan.js';
|
|
3
|
+
export declare function hasOwnSourceDirectives(rawSource: string, scopeToSource?: boolean): boolean;
|
|
3
4
|
export declare function createScopedGeneratorCandidateSignature(rawSource: string, sourceFile: string, fallbackSignature: string, getSourceCandidatesForEntries: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>) | undefined, options?: {
|
|
4
5
|
includeFallbackSignature?: boolean | undefined;
|
|
5
6
|
majorVersion?: number | undefined;
|
|
7
|
+
scopeToSource?: boolean | undefined;
|
|
6
8
|
}): Promise<string>;
|
|
7
|
-
export declare function createScopedGeneratorSourceTraceMap(rawSource: string, sourceFile: string, getSourceCandidateSourcesForEntries: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined
|
|
9
|
+
export declare function createScopedGeneratorSourceTraceMap(rawSource: string, sourceFile: string, getSourceCandidateSourcesForEntries: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined, options?: {
|
|
10
|
+
scopeToSource?: boolean | undefined;
|
|
11
|
+
}): Promise<Map<string, Set<string>> | undefined>;
|
|
8
12
|
export declare function createScopedGeneratorRuntime(options: {
|
|
9
13
|
cssHandlerOptions: {
|
|
10
14
|
isMainChunk?: boolean | undefined;
|
|
@@ -18,5 +22,6 @@ export declare function createScopedGeneratorRuntime(options: {
|
|
|
18
22
|
isMainChunk?: boolean | undefined;
|
|
19
23
|
}) => boolean;
|
|
20
24
|
sourceFile?: string | undefined;
|
|
25
|
+
scopeToSource?: boolean | undefined;
|
|
21
26
|
scopedSourceCandidateGetter: ((entries: TailwindSourceEntry[] | undefined, options?: SourceCandidateFilterOptions) => Set<string>) | undefined;
|
|
22
27
|
}): Promise<Set<string>>;
|
|
@@ -16,10 +16,10 @@ interface CreateSubpackageSourceCandidateScopeOptions {
|
|
|
16
16
|
export declare function createSubpackageSourceCandidateScope(options: CreateSubpackageSourceCandidateScopeOptions): {
|
|
17
17
|
createScopedSourceCandidateGetter: (outputFile: string, cssHandlerOptions: {
|
|
18
18
|
isMainChunk?: boolean | undefined;
|
|
19
|
-
}) => ((entries: TailwindSourceEntry[] | undefined, filterOptions?: SourceCandidateFilterOptions) => Set<string>) | undefined;
|
|
19
|
+
}, sourceFile?: string) => ((entries: TailwindSourceEntry[] | undefined, filterOptions?: SourceCandidateFilterOptions) => Set<string>) | undefined;
|
|
20
20
|
createScopedSourceCandidateSourceGetter: (outputFile: string, cssHandlerOptions: {
|
|
21
21
|
isMainChunk?: boolean | undefined;
|
|
22
|
-
}) => ((entries: TailwindSourceEntry[] | undefined, filterOptions?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined;
|
|
22
|
+
}, sourceFile?: string) => ((entries: TailwindSourceEntry[] | undefined, filterOptions?: SourceCandidateFilterOptions) => Map<string, Set<string>>) | undefined;
|
|
23
23
|
shouldExcludeSubpackageSourceCandidates: (outputFile: string, cssHandlerOptions: {
|
|
24
24
|
isMainChunk?: boolean | undefined;
|
|
25
25
|
}) => boolean;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { RememberedCssSource } from './types.js';
|
|
2
|
+
export declare function createMergedCssSourceTraceMap(sources: Pick<RememberedCssSource, 'rawSource' | 'sourceFile'>[], resolve: (source: Pick<RememberedCssSource, 'rawSource' | 'sourceFile'>) => Promise<Map<string, Set<string>> | undefined>): Promise<Map<string, Set<string>>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface RuntimeClassSetCacheOptions {
|
|
2
|
+
refresh: () => Promise<void>;
|
|
3
|
+
collect: () => Promise<Set<string>>;
|
|
4
|
+
}
|
|
5
|
+
export declare function createRuntimeClassSetCache(options: RuntimeClassSetCacheOptions): {
|
|
6
|
+
get: () => Promise<Set<string>>;
|
|
7
|
+
refresh: () => Promise<void>;
|
|
8
|
+
invalidate: () => void;
|
|
9
|
+
peek: () => Set<string> | undefined;
|
|
10
|
+
revision: () => number;
|
|
11
|
+
remember(next: Set<string>, expectedRevision: number): void;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Plugin, ResolvedConfig } from 'vite';
|
|
2
|
+
interface RuntimeClassSetLifecycleOptions {
|
|
3
|
+
plugins: Plugin[];
|
|
4
|
+
uniAppX: boolean;
|
|
5
|
+
invalidate: () => void;
|
|
6
|
+
isEnabled: () => boolean;
|
|
7
|
+
isRelevant: (id: string) => boolean;
|
|
8
|
+
dispose: () => void;
|
|
9
|
+
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
10
|
+
}
|
|
11
|
+
export declare function installRuntimeClassSetLifecycle(options: RuntimeClassSetLifecycleOptions): void;
|
|
12
|
+
export {};
|
|
@@ -12,6 +12,7 @@ interface CreateViteRuntimeClassSetOptions {
|
|
|
12
12
|
export declare function createViteRuntimeClassSet(options: CreateViteRuntimeClassSetOptions): {
|
|
13
13
|
runtimeState: import("../../compiler/runtime-state.js").CompilerRuntimeState;
|
|
14
14
|
refreshRuntimeState: (force: boolean) => Promise<void>;
|
|
15
|
+
invalidateRuntimeClassSet: () => void;
|
|
15
16
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
16
17
|
ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean, options?: {
|
|
17
18
|
allowBaselineOnlyInitialSync?: boolean | undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { ViteFrameworkBranchContext } from './create-framework-plugins.js';
|
|
2
2
|
import type { ViteFrameworkRuntimeOptions } from './framework-runtime-options.js';
|
|
3
|
-
declare function createViteFrameworkPlugins(options: ViteFrameworkRuntimeOptions | undefined, frameworkBranch: ViteFrameworkBranchContext): any;
|
|
4
|
-
export { createViteFrameworkPlugins };
|
|
3
|
+
export declare function createViteFrameworkPlugins(options: ViteFrameworkRuntimeOptions | undefined, frameworkBranch: ViteFrameworkBranchContext): any;
|
|
@@ -35,6 +35,7 @@ export declare function createFrameworkSourceScanSession(options: FrameworkSourc
|
|
|
35
35
|
pendingHotUpdateChangeByFile: number;
|
|
36
36
|
sourceCandidateScanCache: number;
|
|
37
37
|
};
|
|
38
|
+
getWatchFiles: () => Set<string>;
|
|
38
39
|
invalidate: () => void;
|
|
39
40
|
isDependency: (file: string) => boolean;
|
|
40
41
|
matches: (file: string) => boolean;
|
|
@@ -2,10 +2,10 @@ import { g as resolveTailwindV4EntriesFromCssCached, i as resolveUniAppXOptions
|
|
|
2
2
|
import { detectAppType } from "./framework.js";
|
|
3
3
|
import { T as omitUndefined } from "./generator-LqofzXgr.js";
|
|
4
4
|
import { n as hasCssMacroTailwindV4CustomVariantConditionalComments } from "./auto-ENr4xzzw.js";
|
|
5
|
-
import { V as isSourceStyleRequest } from "./hmr-timing-
|
|
5
|
+
import { V as isSourceStyleRequest } from "./hmr-timing-Bb54exB0.js";
|
|
6
6
|
import { c as getViteHookHandler, o as normalizeStyleInjectorOptions, s as resolveStyleInjectorSubPackages } from "./source-candidate-scan-signature-BWLf4tuO.js";
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
7
|
+
import { analyzeTailwindV4EntrySource, finalizeMiniProgramCss as finalizeMiniProgramCss$1, hasMiniProgramCssSpecificityPlaceholders, pruneMiniProgramGeneratedCss, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss/transform";
|
|
8
|
+
import { sourcePathApi } from "@weapp-tailwindcss/source-scan";
|
|
9
9
|
import { weappStyleInjector } from "weapp-style-injector/vite";
|
|
10
10
|
import { StyleInjector } from "weapp-style-injector/vite/taro";
|
|
11
11
|
import { StyleInjector as StyleInjector$1 } from "weapp-style-injector/vite/uni-app";
|
|
@@ -282,12 +282,15 @@ function hasRuntimeAffectingSourceChanges(changedByType) {
|
|
|
282
282
|
}
|
|
283
283
|
//#endregion
|
|
284
284
|
//#region src/bundlers/vite/generate-bundle/scoped-generator.ts
|
|
285
|
-
function hasOwnSourceDirectives(rawSource) {
|
|
286
|
-
|
|
285
|
+
function hasOwnSourceDirectives(rawSource, scopeToSource = false) {
|
|
286
|
+
const analysis = analyzeTailwindV4EntrySource(rawSource);
|
|
287
|
+
if (!analysis) return false;
|
|
288
|
+
const directives = analysis.getSourceDirectives();
|
|
289
|
+
return analysis.configRequests.length > 0 || scopeToSource && directives.hasSourceNone || Boolean(directives.importSourcePath) || directives.sourceRequests.length > 0 || directives.inlineCandidates.included.size > 0 || directives.inlineCandidates.excluded.size > 0;
|
|
287
290
|
}
|
|
288
291
|
function createLocalSourceEntries(sourceFile) {
|
|
289
292
|
return [{
|
|
290
|
-
base:
|
|
293
|
+
base: sourcePathApi(sourceFile).dirname(sourcePathApi(sourceFile).resolve(sourceFile.replace(/[?#].*$/, ""))),
|
|
291
294
|
negated: false,
|
|
292
295
|
pattern: "**/*"
|
|
293
296
|
}];
|
|
@@ -305,36 +308,36 @@ function mergeCandidates(first, second) {
|
|
|
305
308
|
function canFallbackToOutputCandidates(rawSource, entries) {
|
|
306
309
|
return rawSource.includes("@source") && entries.length > 0 && entries.every((entry) => !entry.negated);
|
|
307
310
|
}
|
|
308
|
-
function resolveScopedSourceEntries(rawSource, sourceFile, resolvedEntries) {
|
|
309
|
-
if (!hasOwnSourceDirectives(rawSource)) return {
|
|
311
|
+
function resolveScopedSourceEntries(rawSource, sourceFile, resolvedEntries, scopeToSource = false) {
|
|
312
|
+
if (!hasOwnSourceDirectives(rawSource, scopeToSource)) return {
|
|
310
313
|
entries: resolvedEntries,
|
|
311
314
|
localEntries: void 0
|
|
312
315
|
};
|
|
313
316
|
if (resolvedEntries !== void 0) return { entries: resolvedEntries };
|
|
314
317
|
return { entries: createLocalSourceEntries(sourceFile) };
|
|
315
318
|
}
|
|
316
|
-
async function resolveScopedGeneratorSourceEntries(rawSource, sourceFile) {
|
|
317
|
-
const sourceBase =
|
|
318
|
-
return resolveScopedSourceEntries(rawSource, sourceFile, (await resolveTailwindV4EntriesFromCssCached(rawSource, sourceBase))?.entries);
|
|
319
|
+
async function resolveScopedGeneratorSourceEntries(rawSource, sourceFile, scopeToSource = false) {
|
|
320
|
+
const sourceBase = sourcePathApi(sourceFile).dirname(sourcePathApi(sourceFile).resolve(sourceFile.replace(/[?#].*$/, "")));
|
|
321
|
+
return resolveScopedSourceEntries(rawSource, sourceFile, (await resolveTailwindV4EntriesFromCssCached(rawSource, sourceBase))?.entries, scopeToSource);
|
|
319
322
|
}
|
|
320
323
|
async function createScopedGeneratorCandidateSignature(rawSource, sourceFile, fallbackSignature, getSourceCandidatesForEntries, options = {}) {
|
|
321
|
-
if (!getSourceCandidatesForEntries || !hasOwnSourceDirectives(rawSource)) return fallbackSignature;
|
|
322
|
-
const { entries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
324
|
+
if (!getSourceCandidatesForEntries || !hasOwnSourceDirectives(rawSource, options.scopeToSource)) return fallbackSignature;
|
|
325
|
+
const { entries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile, options.scopeToSource);
|
|
323
326
|
if (entries === void 0) return fallbackSignature;
|
|
324
327
|
const scopedSignature = createCandidateSignature(getSourceCandidatesForEntries(entries));
|
|
325
328
|
return options.includeFallbackSignature === true ? `${scopedSignature}:${fallbackSignature}` : scopedSignature;
|
|
326
329
|
}
|
|
327
|
-
async function createScopedGeneratorSourceTraceMap(rawSource, sourceFile, getSourceCandidateSourcesForEntries) {
|
|
328
|
-
if (!getSourceCandidateSourcesForEntries || !hasOwnSourceDirectives(rawSource)) return getSourceCandidateSourcesForEntries?.(void 0);
|
|
329
|
-
const { entries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
330
|
+
async function createScopedGeneratorSourceTraceMap(rawSource, sourceFile, getSourceCandidateSourcesForEntries, options = {}) {
|
|
331
|
+
if (!getSourceCandidateSourcesForEntries || !hasOwnSourceDirectives(rawSource, options.scopeToSource)) return getSourceCandidateSourcesForEntries?.(void 0);
|
|
332
|
+
const { entries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile, options.scopeToSource);
|
|
330
333
|
if (entries === void 0) return getSourceCandidateSourcesForEntries(void 0);
|
|
331
334
|
return getSourceCandidateSourcesForEntries(entries);
|
|
332
335
|
}
|
|
333
336
|
async function createScopedGeneratorRuntime(options) {
|
|
334
|
-
const { cssHandlerOptions, fallbackRuntime, getSourceCandidatesForEntries, outputFile, rawSource, shouldExcludeSubpackageSourceCandidates, sourceFile, scopedSourceCandidateGetter } = options;
|
|
337
|
+
const { cssHandlerOptions, fallbackRuntime, getSourceCandidatesForEntries, outputFile, rawSource, shouldExcludeSubpackageSourceCandidates, sourceFile, scopeToSource, scopedSourceCandidateGetter } = options;
|
|
335
338
|
if (getSourceCandidatesForEntries && rawSource && sourceFile) {
|
|
336
|
-
const { entries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile);
|
|
337
|
-
if (entries !== void 0 && (entries.length > 0 || hasOwnSourceDirectives(rawSource))) {
|
|
339
|
+
const { entries } = await resolveScopedGeneratorSourceEntries(rawSource, sourceFile, scopeToSource);
|
|
340
|
+
if (entries !== void 0 && (entries.length > 0 || hasOwnSourceDirectives(rawSource, scopeToSource))) {
|
|
338
341
|
const explicitCandidates = getSourceCandidatesForEntries(entries);
|
|
339
342
|
const outputCandidates = scopedSourceCandidateGetter?.(void 0);
|
|
340
343
|
const scopedCandidates = outputCandidates ? explicitCandidates.size === 0 && canFallbackToOutputCandidates(rawSource, entries) ? outputCandidates : intersectCandidates(explicitCandidates, outputCandidates) : explicitCandidates;
|
|
@@ -347,4 +350,4 @@ async function createScopedGeneratorRuntime(options) {
|
|
|
347
350
|
return fallbackRuntime;
|
|
348
351
|
}
|
|
349
352
|
//#endregion
|
|
350
|
-
export {
|
|
353
|
+
export { resolveWebpackFrameworkProfile as S, createBuiltinViteStyleInjectorPlugins as _, createScopedGeneratorCandidateSignature as a, webpackStyleInjectorDelegates as b, hasOwnSourceDirectives as c, createLinkedImpactSignature as d, getSnapshotHash as f, resolvePluginDisabledState as g, classifyRuntimeEntry as h, stripMiniProgramCssSpecificityPlaceholders as i, createCandidateSignature as l, summarizeStringDiff as m, hasMiniProgramCssSpecificityPlaceholders as n, createScopedGeneratorRuntime as o, hasRuntimeAffectingSourceChanges as p, pruneMiniProgramGeneratedCss as r, createScopedGeneratorSourceTraceMap as s, finalizeMiniProgramCss$1 as t, createJsHashSalt as u, createBuiltinWebpackStyleInjectorPlugin as v, resolveViteFrameworkProfile as x, viteStyleInjectorDelegates as y };
|
|
@@ -461,6 +461,30 @@ function diffCandidateSets(previous, next) {
|
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
463
|
//#endregion
|
|
464
|
+
//#region src/project-sources/candidates/view-memo.ts
|
|
465
|
+
/** 按候选版本和来源范围缓存视图,限制历史版本的驻留数量。 */
|
|
466
|
+
function createCandidateViewMemo() {
|
|
467
|
+
const memo = /* @__PURE__ */ new Map();
|
|
468
|
+
return (kind, revision, entries, excludeEntries, collect) => {
|
|
469
|
+
if (entries === void 0 && !excludeEntries?.length) return collect();
|
|
470
|
+
const key = `${revision}\0${JSON.stringify(entries ?? null)}\0${JSON.stringify(excludeEntries ?? null)}`;
|
|
471
|
+
const cached = memo.get(key);
|
|
472
|
+
const view = cached?.[kind];
|
|
473
|
+
if (view) return view;
|
|
474
|
+
const result = collect();
|
|
475
|
+
const next = cached ?? {};
|
|
476
|
+
next[kind] = result;
|
|
477
|
+
memo.delete(key);
|
|
478
|
+
memo.set(key, next);
|
|
479
|
+
while (memo.size > 64) {
|
|
480
|
+
const oldest = memo.keys().next().value;
|
|
481
|
+
if (oldest === void 0) break;
|
|
482
|
+
memo.delete(oldest);
|
|
483
|
+
}
|
|
484
|
+
return result;
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
464
488
|
//#region src/project-sources/candidates/views.ts
|
|
465
489
|
function isIncludedFile(id, isActiveModule, entries, excludeEntries) {
|
|
466
490
|
if (entries !== void 0 && (isActiveModule ? (0, require_tailwindcss.source_scan_exports.isFileExcludedByTailwindSourceEntries)(id, entries) : entries.length === 0 || !(0, require_tailwindcss.source_scan_exports.isFileMatchedByTailwindSourceEntries)(id, entries))) return false;
|
|
@@ -520,6 +544,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
520
544
|
const moduleSourceById = /* @__PURE__ */ new Map();
|
|
521
545
|
const candidateCount = /* @__PURE__ */ new Map();
|
|
522
546
|
const fileCandidateMemo = /* @__PURE__ */ new Map();
|
|
547
|
+
const candidateViewMemo = createCandidateViewMemo();
|
|
523
548
|
let inlineIncludedCandidates = /* @__PURE__ */ new Set();
|
|
524
549
|
let inlineExcludedCandidates = /* @__PURE__ */ new Set();
|
|
525
550
|
let revision = 0;
|
|
@@ -728,22 +753,22 @@ function createSourceCandidateStore(options = {}) {
|
|
|
728
753
|
});
|
|
729
754
|
}
|
|
730
755
|
function valuesForEntries(entries, options = {}) {
|
|
731
|
-
return collectCandidateValues({
|
|
756
|
+
return candidateViewMemo("values", revision, entries, options.excludeEntries, () => collectCandidateValues({
|
|
732
757
|
candidatesById,
|
|
733
758
|
moduleCandidatesById,
|
|
734
759
|
candidateCount,
|
|
735
760
|
inlineIncludedCandidates,
|
|
736
761
|
inlineExcludedCandidates
|
|
737
|
-
}, entries, options.excludeEntries);
|
|
762
|
+
}, entries, options.excludeEntries));
|
|
738
763
|
}
|
|
739
764
|
function sourcesForEntries(entries, options = {}) {
|
|
740
|
-
return collectCandidateSources({
|
|
765
|
+
return candidateViewMemo("sources", revision, entries, options.excludeEntries, () => collectCandidateSources({
|
|
741
766
|
candidatesById,
|
|
742
767
|
moduleCandidatesById,
|
|
743
768
|
candidateCount,
|
|
744
769
|
inlineIncludedCandidates,
|
|
745
770
|
inlineExcludedCandidates
|
|
746
|
-
}, entries, options.excludeEntries);
|
|
771
|
+
}, entries, options.excludeEntries));
|
|
747
772
|
}
|
|
748
773
|
function clear() {
|
|
749
774
|
if (candidateCount.size > 0 || fileCandidateMemo.size > 0 || inlineIncludedCandidates.size > 0 || inlineExcludedCandidates.size > 0) revision++;
|
|
@@ -2206,6 +2231,28 @@ async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, fi
|
|
|
2206
2231
|
//#endregion
|
|
2207
2232
|
//#region src/generation/source-resolver/resolve-sources.ts
|
|
2208
2233
|
async function resolveGeneratorResolvedSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions) {
|
|
2234
|
+
const ownedSources = resolveCssHandlerSourceOptions(cssHandlerOptions)?.cssSources;
|
|
2235
|
+
if (ownedSources?.length) {
|
|
2236
|
+
const sourceOptions = {
|
|
2237
|
+
...require_generator.resolveTailwindV4SourceOptionsFromRuntime(runtimeState.tailwindRuntime),
|
|
2238
|
+
cssEntries: [],
|
|
2239
|
+
cssSources: ownedSources
|
|
2240
|
+
};
|
|
2241
|
+
return Promise.all(ownedSources.map(async (source, index) => {
|
|
2242
|
+
const resolved = await resolveSingleTailwindV4CssSource(source, sourceOptions, {
|
|
2243
|
+
index,
|
|
2244
|
+
matched: true,
|
|
2245
|
+
primary: index === 0
|
|
2246
|
+
});
|
|
2247
|
+
return normalizeResolvedTailwindV4SourceConfig(withGeneratorSourceMetadata(generatorOptions?.config ? {
|
|
2248
|
+
...resolved,
|
|
2249
|
+
css: (0, _weapp_tailwindcss_postcss_transform.prependConfigDirective)(resolved.css, generatorOptions.config)
|
|
2250
|
+
} : resolved, {
|
|
2251
|
+
...getGeneratorSourceMetadata(resolved),
|
|
2252
|
+
isolateCssSource: ownedSources.length > 1 || /source\(\s*none\s*\)/i.test(source.css)
|
|
2253
|
+
}), source.file, sourceOptions);
|
|
2254
|
+
}));
|
|
2255
|
+
}
|
|
2209
2256
|
const base = resolveCssSourceBase(file, cssHandlerOptions);
|
|
2210
2257
|
const cssEntrySource = (0, _weapp_tailwindcss_postcss_transform.resolveCssEntrySource)(rawSource, base, {
|
|
2211
2258
|
importFallback: generatorOptions?.importFallback ?? false,
|
|
@@ -2947,8 +2994,9 @@ async function prepareGeneratorInputs(context) {
|
|
|
2947
2994
|
...source,
|
|
2948
2995
|
css: sourceCss
|
|
2949
2996
|
};
|
|
2997
|
+
const entryCssCandidates = Boolean(cssHandlerOptions.sourceOptions?.cssSources?.length) ? (0, _weapp_tailwindcss_postcss_transform.collectGeneratorCssCandidates)(sourceMetadata.sourceCss ?? source.css) : currentCssCandidates;
|
|
2950
2998
|
const sourceEntries = getSourceCandidatesForEntries ? await resolveGeneratorSourceEntries(record, runtimeState) : void 0;
|
|
2951
|
-
const sourceScopedRuntime = sourceEntries && sourceEntries.length > 0 ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
2999
|
+
const sourceScopedRuntime = sourceEntries !== void 0 && (sourceEntries.length > 0 || sourceMetadata.isolateCssSource === true) ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
2952
3000
|
const scopedRuntime = resolveScopedRuntimeCandidates(options.sourceCandidates, sourceScopedRuntime);
|
|
2953
3001
|
const isolateCssSource = shouldIsolateScopedCssSource(majorVersion, record, sourceEntries, {
|
|
2954
3002
|
cssHandlerOptions,
|
|
@@ -2960,7 +3008,7 @@ async function prepareGeneratorInputs(context) {
|
|
|
2960
3008
|
return;
|
|
2961
3009
|
}
|
|
2962
3010
|
const sourceRuntime = scopedRuntime && (scopedRuntime.size > 0 || isolateCssSource) || isolateCssSource ? isolateCurrentCssCandidates ? runtimeWithCurrentCss : mergeScopedRuntimeWithCurrentRuntime(scopedRuntime ?? /* @__PURE__ */ new Set(), runtimeWithCurrentCss, {
|
|
2963
|
-
currentCssCandidates,
|
|
3011
|
+
currentCssCandidates: entryCssCandidates,
|
|
2964
3012
|
cssHandlerOptions,
|
|
2965
3013
|
isolateCssSource,
|
|
2966
3014
|
majorVersion,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-XNfJSlhp.js";
|
|
2
2
|
import { R as getTailwindV4IncrementalGenerateCacheStats, _ as upsertTailwindV4CssSource, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots } from "./generator-LqofzXgr.js";
|
|
3
3
|
import { A as createTailwindRuntimeReadyPromise, B as invalidateCompilationScope, G as createCompilationDependencyChanges, I as AssetEmissionPlan, N as createDebug, V as recordCompilationDependencyChanges, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as ensureRuntimeClassSet, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, y as shouldSkipJsTransform, z as getCompilationScopeDependencyRevision } from "./compiler-v9sYta8W.js";
|
|
4
|
-
import { J as splitLocalCssImports, R as finalizeMiniProgramGeneratorCss, U as createRuntimeClassSetManager, Y as createSourceCandidateCollector, a as hasBundlerGeneratedCssMarker, c as annotateCssSourceTrace, dt as finalizeCompilerShadowRun, f as generateTailwindV4Css, i as createBundlerGeneratedCssMarker, it as hasTailwindRootDirectives, l as createCssSourceTraceCacheSignature, n as emitHmrTiming, ot as normalizeTailwindConfigDirectives, q as rewriteLocalCssImportRequestsForOutput, s as stripBundlerGeneratedCssMarkers, st as normalizeTailwindSourceForGenerator, u as createCssTokenSourceMap, ut as prependConfigDirective } from "./hmr-timing-
|
|
4
|
+
import { J as splitLocalCssImports, R as finalizeMiniProgramGeneratorCss, U as createRuntimeClassSetManager, Y as createSourceCandidateCollector, a as hasBundlerGeneratedCssMarker, c as annotateCssSourceTrace, dt as finalizeCompilerShadowRun, f as generateTailwindV4Css, i as createBundlerGeneratedCssMarker, it as hasTailwindRootDirectives, l as createCssSourceTraceCacheSignature, n as emitHmrTiming, ot as normalizeTailwindConfigDirectives, q as rewriteLocalCssImportRequestsForOutput, s as stripBundlerGeneratedCssMarkers, st as normalizeTailwindSourceForGenerator, u as createCssTokenSourceMap, ut as prependConfigDirective } from "./hmr-timing-Bb54exB0.js";
|
|
5
5
|
import { a as createRuntimeCompilationBuildState, c as updateRuntimeCompilationBuildState, n as processCachedTask, o as removeRuntimeCompilationBuildStateFiles, r as buildRuntimeCompilationSnapshot, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-BOzhuhGz.js";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
@@ -3,9 +3,9 @@ const require_generator = require("./generator-B1sYQpWu.cjs");
|
|
|
3
3
|
const require_compiler = require("./compiler-TvqqdOMD.cjs");
|
|
4
4
|
const require_runtime_state = require("./runtime-state-BOzuVoKl.cjs");
|
|
5
5
|
const require_tailwindcss = require("./tailwindcss-uf04Iolj.cjs");
|
|
6
|
-
const require_generated_css_marker = require("./generated-css-marker-
|
|
6
|
+
const require_generated_css_marker = require("./generated-css-marker-nqjR6ntO.cjs");
|
|
7
7
|
const require_cache = require("./cache-CzvIGfwS.cjs");
|
|
8
|
-
const require_hmr_timing = require("./hmr-timing-
|
|
8
|
+
const require_hmr_timing = require("./hmr-timing-B56wp7y-.cjs");
|
|
9
9
|
require("./final-css-cleanup-B6FUJC3z.cjs");
|
|
10
10
|
let node_fs = require("node:fs");
|
|
11
11
|
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
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-DrX6QS3N.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-BCV0gOMb.js";
|
|
2
2
|
export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };
|
|
@@ -2,7 +2,7 @@ const require_rolldown_runtime = require("./rolldown-runtime-fg3euq-1.cjs");
|
|
|
2
2
|
const require_generator = require("./generator-B1sYQpWu.cjs");
|
|
3
3
|
const require_compiler = require("./compiler-TvqqdOMD.cjs");
|
|
4
4
|
const require_tailwindcss = require("./tailwindcss-uf04Iolj.cjs");
|
|
5
|
-
const require_generated_css_marker = require("./generated-css-marker-
|
|
5
|
+
const require_generated_css_marker = require("./generated-css-marker-nqjR6ntO.cjs");
|
|
6
6
|
let node_process = require("node:process");
|
|
7
7
|
node_process = require_rolldown_runtime.__toESM(node_process, 1);
|
|
8
8
|
let _weapp_tailwindcss_engine = require("@weapp-tailwindcss/engine");
|
|
@@ -500,6 +500,30 @@ function diffCandidateSets(previous, next) {
|
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
502
|
//#endregion
|
|
503
|
+
//#region src/project-sources/candidates/view-memo.ts
|
|
504
|
+
/** 按候选版本和来源范围缓存视图,限制历史版本的驻留数量。 */
|
|
505
|
+
function createCandidateViewMemo() {
|
|
506
|
+
const memo = /* @__PURE__ */ new Map();
|
|
507
|
+
return (kind, revision, entries, excludeEntries, collect) => {
|
|
508
|
+
if (entries === void 0 && !excludeEntries?.length) return collect();
|
|
509
|
+
const key = `${revision}\0${JSON.stringify(entries ?? null)}\0${JSON.stringify(excludeEntries ?? null)}`;
|
|
510
|
+
const cached = memo.get(key);
|
|
511
|
+
const view = cached?.[kind];
|
|
512
|
+
if (view) return view;
|
|
513
|
+
const result = collect();
|
|
514
|
+
const next = cached ?? {};
|
|
515
|
+
next[kind] = result;
|
|
516
|
+
memo.delete(key);
|
|
517
|
+
memo.set(key, next);
|
|
518
|
+
while (memo.size > 64) {
|
|
519
|
+
const oldest = memo.keys().next().value;
|
|
520
|
+
if (oldest === void 0) break;
|
|
521
|
+
memo.delete(oldest);
|
|
522
|
+
}
|
|
523
|
+
return result;
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
//#endregion
|
|
503
527
|
//#region src/project-sources/candidates/views.ts
|
|
504
528
|
function isIncludedFile(id, isActiveModule, entries, excludeEntries) {
|
|
505
529
|
if (entries !== void 0 && (isActiveModule ? (0, source_scan_exports.isFileExcludedByTailwindSourceEntries)(id, entries) : entries.length === 0 || !(0, source_scan_exports.isFileMatchedByTailwindSourceEntries)(id, entries))) return false;
|
|
@@ -559,6 +583,7 @@ function createSourceCandidateStore(options = {}) {
|
|
|
559
583
|
const moduleSourceById = /* @__PURE__ */ new Map();
|
|
560
584
|
const candidateCount = /* @__PURE__ */ new Map();
|
|
561
585
|
const fileCandidateMemo = /* @__PURE__ */ new Map();
|
|
586
|
+
const candidateViewMemo = createCandidateViewMemo();
|
|
562
587
|
let inlineIncludedCandidates = /* @__PURE__ */ new Set();
|
|
563
588
|
let inlineExcludedCandidates = /* @__PURE__ */ new Set();
|
|
564
589
|
let revision = 0;
|
|
@@ -767,22 +792,22 @@ function createSourceCandidateStore(options = {}) {
|
|
|
767
792
|
});
|
|
768
793
|
}
|
|
769
794
|
function valuesForEntries(entries, options = {}) {
|
|
770
|
-
return collectCandidateValues({
|
|
795
|
+
return candidateViewMemo("values", revision, entries, options.excludeEntries, () => collectCandidateValues({
|
|
771
796
|
candidatesById,
|
|
772
797
|
moduleCandidatesById,
|
|
773
798
|
candidateCount,
|
|
774
799
|
inlineIncludedCandidates,
|
|
775
800
|
inlineExcludedCandidates
|
|
776
|
-
}, entries, options.excludeEntries);
|
|
801
|
+
}, entries, options.excludeEntries));
|
|
777
802
|
}
|
|
778
803
|
function sourcesForEntries(entries, options = {}) {
|
|
779
|
-
return collectCandidateSources({
|
|
804
|
+
return candidateViewMemo("sources", revision, entries, options.excludeEntries, () => collectCandidateSources({
|
|
780
805
|
candidatesById,
|
|
781
806
|
moduleCandidatesById,
|
|
782
807
|
candidateCount,
|
|
783
808
|
inlineIncludedCandidates,
|
|
784
809
|
inlineExcludedCandidates
|
|
785
|
-
}, entries, options.excludeEntries);
|
|
810
|
+
}, entries, options.excludeEntries));
|
|
786
811
|
}
|
|
787
812
|
function clear() {
|
|
788
813
|
if (candidateCount.size > 0 || fileCandidateMemo.size > 0 || inlineIncludedCandidates.size > 0 || inlineExcludedCandidates.size > 0) revision++;
|
|
@@ -2424,6 +2449,28 @@ async function resolveGeneratorSource(_majorVersion, runtimeState, rawSource, fi
|
|
|
2424
2449
|
//#endregion
|
|
2425
2450
|
//#region src/generation/source-resolver/resolve-sources.ts
|
|
2426
2451
|
async function resolveGeneratorResolvedSources(majorVersion, runtimeState, rawSource, file, cssHandlerOptions, generatorOptions, selectionOptions) {
|
|
2452
|
+
const ownedSources = resolveCssHandlerSourceOptions(cssHandlerOptions)?.cssSources;
|
|
2453
|
+
if (ownedSources?.length) {
|
|
2454
|
+
const sourceOptions = {
|
|
2455
|
+
...resolveTailwindV4SourceOptionsFromRuntime(runtimeState.tailwindRuntime),
|
|
2456
|
+
cssEntries: [],
|
|
2457
|
+
cssSources: ownedSources
|
|
2458
|
+
};
|
|
2459
|
+
return Promise.all(ownedSources.map(async (source, index) => {
|
|
2460
|
+
const resolved = await resolveSingleTailwindV4CssSource(source, sourceOptions, {
|
|
2461
|
+
index,
|
|
2462
|
+
matched: true,
|
|
2463
|
+
primary: index === 0
|
|
2464
|
+
});
|
|
2465
|
+
return normalizeResolvedTailwindV4SourceConfig(withGeneratorSourceMetadata(generatorOptions?.config ? {
|
|
2466
|
+
...resolved,
|
|
2467
|
+
css: prependConfigDirective(resolved.css, generatorOptions.config)
|
|
2468
|
+
} : resolved, {
|
|
2469
|
+
...getGeneratorSourceMetadata(resolved),
|
|
2470
|
+
isolateCssSource: ownedSources.length > 1 || /source\(\s*none\s*\)/i.test(source.css)
|
|
2471
|
+
}), source.file, sourceOptions);
|
|
2472
|
+
}));
|
|
2473
|
+
}
|
|
2427
2474
|
const base = resolveCssSourceBase(file, cssHandlerOptions);
|
|
2428
2475
|
const cssEntrySource = resolveCssEntrySource$1(rawSource, base, {
|
|
2429
2476
|
importFallback: generatorOptions?.importFallback ?? false,
|
|
@@ -3165,8 +3212,9 @@ async function prepareGeneratorInputs(context) {
|
|
|
3165
3212
|
...source,
|
|
3166
3213
|
css: sourceCss
|
|
3167
3214
|
};
|
|
3215
|
+
const entryCssCandidates = Boolean(cssHandlerOptions.sourceOptions?.cssSources?.length) ? collectGeneratorCssCandidates(sourceMetadata.sourceCss ?? source.css) : currentCssCandidates;
|
|
3168
3216
|
const sourceEntries = getSourceCandidatesForEntries ? await resolveGeneratorSourceEntries(record, runtimeState) : void 0;
|
|
3169
|
-
const sourceScopedRuntime = sourceEntries && sourceEntries.length > 0 ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
3217
|
+
const sourceScopedRuntime = sourceEntries !== void 0 && (sourceEntries.length > 0 || sourceMetadata.isolateCssSource === true) ? getSourceCandidatesForEntries?.(sourceEntries) : void 0;
|
|
3170
3218
|
const scopedRuntime = resolveScopedRuntimeCandidates(options.sourceCandidates, sourceScopedRuntime);
|
|
3171
3219
|
const isolateCssSource = shouldIsolateScopedCssSource(majorVersion, record, sourceEntries, {
|
|
3172
3220
|
cssHandlerOptions,
|
|
@@ -3178,7 +3226,7 @@ async function prepareGeneratorInputs(context) {
|
|
|
3178
3226
|
return;
|
|
3179
3227
|
}
|
|
3180
3228
|
const sourceRuntime = scopedRuntime && (scopedRuntime.size > 0 || isolateCssSource) || isolateCssSource ? isolateCurrentCssCandidates ? runtimeWithCurrentCss : mergeScopedRuntimeWithCurrentRuntime(scopedRuntime ?? /* @__PURE__ */ new Set(), runtimeWithCurrentCss, {
|
|
3181
|
-
currentCssCandidates,
|
|
3229
|
+
currentCssCandidates: entryCssCandidates,
|
|
3182
3230
|
cssHandlerOptions,
|
|
3183
3231
|
isolateCssSource,
|
|
3184
3232
|
majorVersion,
|
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-B1sYQpWu.cjs");
|
|
4
|
-
const require_gulp = require("./gulp-
|
|
4
|
+
const require_gulp = require("./gulp-DrX6QS3N.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-C3Zh6iYK.cjs");
|
|
7
|
+
const require_webpack = require("./webpack-Dbj2uykF.cjs");
|
|
8
8
|
require("./webpack.cjs");
|
|
9
9
|
let _weapp_tailwindcss_postcss_transform = require("@weapp-tailwindcss/postcss/transform");
|
|
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-LqofzXgr.js";
|
|
3
|
-
import { t as createPlugins } from "./gulp-
|
|
3
|
+
import { t as createPlugins } from "./gulp-BCV0gOMb.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-D6_FxvdM.js";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-BZBqKB4Y.js";
|
|
7
7
|
import "./webpack.js";
|
|
8
8
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss/transform";
|
|
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 };
|
|
@@ -2,7 +2,7 @@ const require_rolldown_runtime = require("./rolldown-runtime-fg3euq-1.cjs");
|
|
|
2
2
|
const require_generator = require("./generator-B1sYQpWu.cjs");
|
|
3
3
|
const require_compiler = require("./compiler-TvqqdOMD.cjs");
|
|
4
4
|
const require_defaults = require("./defaults-CyX5iO9y.cjs");
|
|
5
|
-
const require_generated_css_marker = require("./generated-css-marker-
|
|
5
|
+
const require_generated_css_marker = require("./generated-css-marker-nqjR6ntO.cjs");
|
|
6
6
|
require("./final-css-cleanup-B6FUJC3z.cjs");
|
|
7
7
|
require("./css-cleanup-B6FUJC3z.cjs");
|
|
8
8
|
let node_path = require("node:path");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TailwindSourceEntry } from '../../tailwindcss/source-scan.js';
|
|
2
|
+
interface CandidateViews {
|
|
3
|
+
values: Set<string>;
|
|
4
|
+
sources: Map<string, Set<string>>;
|
|
5
|
+
}
|
|
6
|
+
export declare function createCandidateViewMemo(): <K extends keyof CandidateViews>(kind: K, revision: number, entries: TailwindSourceEntry[] | undefined, excludeEntries: TailwindSourceEntry[] | undefined, collect: () => CandidateViews[K]) => CandidateViews[K];
|
|
7
|
+
export {};
|