weapp-tailwindcss
Version:
把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!
70 lines (69 loc) • 3.92 kB
TypeScript
import type { OutputAsset, OutputChunk } from 'rollup';
import type { BundleBuildState, BundleSnapshot } from '../../bundle-state.js';
import type { ViteFrameworkCssPipelineContext, ViteFrameworkCssPipelineStrategy } from '../../shared/framework-strategy.js';
import type { BundleMetrics } from '../metrics.js';
import type { GenerateBundleContext } from '../types.js';
export interface FinalizeGenerateBundleOptions {
activeProcessCacheKeys: Set<string>;
activeProcessHashKeys: Set<string | number>;
activeViteCssCacheFiles: Set<string>;
bundle: Record<string, OutputAsset | OutputChunk>;
bundleFiles: string[];
cache: GenerateBundleContext['opts']['cache'];
cssTaskFactories: Array<() => Promise<void>>;
cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy | undefined;
createCssPipelineContext?: ((file: string) => ViteFrameworkCssPipelineContext) | undefined;
debug: GenerateBundleContext['debug'];
defaultStyleOutputExtension: string;
formatIteration: number;
generatorCandidateSignature: string;
generatorRuntime: Set<string>;
getCssHandlerOptions: (file: string) => ReturnType<ReturnType<typeof import('./css-handler-options.js').createCssHandlerOptionsCache>['getCssHandlerOptions']>;
getSourceCandidateSourcesForEntries: GenerateBundleContext['getSourceCandidateSourcesForEntries'];
getSourceCandidatesForEntries: GenerateBundleContext['getSourceCandidatesForEntries'];
getViteCssCacheStats: GenerateBundleContext['getViteCssCacheStats'];
getViteProcessedCssAssetResults: GenerateBundleContext['getViteProcessedCssAssetResults'];
hmrTimingRecorder: GenerateBundleContext['hmrTimingRecorder'];
hmrTimingStartedAt: number;
isHarmonyAppStyleTarget: boolean;
isNativeAppStyleTarget: boolean;
isViteProcessedCssAsset: GenerateBundleContext['isViteProcessedCssAsset'];
isWebGeneratorTarget: boolean;
jsAfterCss: boolean;
jsTaskFactories: Array<() => Promise<void>>;
lastCssResultByFile: Map<string, string>;
lastCssSourceHashByFile: Map<string, string>;
linkedByEntry: Map<string, Set<string>> | undefined;
markCssAssetProcessed: GenerateBundleContext['markCssAssetProcessed'];
metrics: BundleMetrics;
onEnd: GenerateBundleContext['opts']['onEnd'];
onUpdate: GenerateBundleContext['opts']['onUpdate'];
opts: GenerateBundleContext['opts'];
outDir: string;
pendingLinkedUpdates: Array<() => void>;
pruneViteCssCaches: GenerateBundleContext['pruneViteCssCaches'];
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
recordTimingDetail: (name: string, startedAt: number) => void;
recordViteProcessedCssAssetResult: GenerateBundleContext['recordViteProcessedCssAssetResult'];
rootDir: string;
runtime: Set<string>;
runtimeState: GenerateBundleContext['runtimeState'];
shouldPreserveAppCssExtension: boolean;
snapshot: BundleSnapshot;
sourceCandidates: Set<string>;
sourceRoot: string | undefined;
state: BundleBuildState;
styleHandler: GenerateBundleContext['opts']['styleHandler'];
tasks: Promise<void>[];
timingDetails: Record<string, number>;
transformRuntime: Set<string>;
transformWebTargetCss?: ((css: string, file: string) => string) | undefined;
useIncrementalMode: boolean;
}
export declare function finalizeWebviewCssCompat(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<FinalizeGenerateBundleOptions, 'debug' | 'onUpdate' | 'opts' | 'recordCssAssetResult'>): number;
export declare function normalizeRootMiniProgramImportShellAssets(bundle: Record<string, OutputAsset | OutputChunk>, options: Pick<GenerateBundleContext['opts'], 'cssMatcher'> & {
debug: GenerateBundleContext['debug'];
enabled: boolean;
onUpdate: GenerateBundleContext['opts']['onUpdate'];
recordCssAssetResult: GenerateBundleContext['recordCssAssetResult'];
}): number;