UNPKG

weapp-tailwindcss

Version:

把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!

59 lines (58 loc) 3.37 kB
import type { Compiler, sources as WebpackSources } from 'webpack'; import type { RuntimeClassSetManager } from '../../../shared/runtime-class-set.js'; import type { WebpackGeneratedCssRegistration } from '../../loaders/runtime-registry.js'; import type { WebpackAssetCompilationLike, WebpackSourceLike } from './asset-emission-plan.js'; import type { RuntimeCompilationBuildState, RuntimeCompilationSnapshot, RuntimeSnapshotEntry } from '../../../../compiler/index.js'; import type { AppType, InternalUserDefinedOptions } from '../../../../types/index.js'; export type { WebpackAssetCompilationLike, WebpackSourceLike } from './asset-emission-plan.js'; export interface SetupWebpackV5ProcessAssetsHookOptions { compiler: Compiler; options: InternalUserDefinedOptions; appType?: AppType | undefined; runtimeState: { tailwindRuntime: InternalUserDefinedOptions['tailwindRuntime']; readyPromise: Promise<void>; }; getRuntimeRefreshRequirement: () => boolean; refreshRuntimeMetadata: (force: boolean) => Promise<void>; isKnownWebpackProcessedCssAsset?: ((file: string, metadata?: { isMainCssChunk?: boolean | undefined; }) => boolean) | undefined; isWebpackProcessedCssAsset?: ((file: string, rawSource: string, metadata?: { isMainCssChunk?: boolean | undefined; }) => boolean) | undefined; consumeRuntimeRefreshRequirement: () => void; isWatchMode?: (() => boolean) | undefined; getWatchChangedFiles?: (() => Iterable<string>) | undefined; runtimeClassSetManager?: RuntimeClassSetManager | undefined; getWebpackCssSources?: (() => Iterable<[string, { css: string | undefined; processed?: boolean | undefined; }]>) | undefined; getWebpackGeneratedCssSources?: (() => Iterable<[string, WebpackGeneratedCssRegistration]>) | undefined; pruneWebpackCssSources?: ((activeSourceFiles: ReadonlySet<string>, options?: { watchMode?: boolean | undefined; }) => void) | undefined; prepareWebpackCssSources?: ((activeAssetResources?: ReadonlySet<string>) => ReadonlySet<string>) | undefined; debug: (format: string, ...args: unknown[]) => void; } export interface BuildWebpackBundleSnapshotOptions { removedFiles?: Iterable<string> | undefined; } export declare function buildWebpackBundleSnapshot(assets: Record<string, { source: () => unknown; }>, opts: InternalUserDefinedOptions, state: RuntimeCompilationBuildState, compilation?: WebpackAssetCompilationLike | undefined, options?: BuildWebpackBundleSnapshotOptions): RuntimeCompilationSnapshot<RuntimeSnapshotEntry>; export declare function releaseWebpackBundleSnapshotSources(snapshot: RuntimeCompilationSnapshot): void; export declare function stringifyWebpackSource(source: unknown): string; export declare function createWebpackAssetUpdater(options: { compilation: WebpackAssetCompilationLike; ConcatSource: new (source: string) => WebpackSources.Source; onUpdate: (file: string, previousSource: string, nextSource: string) => void; debug: (format: string, ...args: unknown[]) => void; }): { getCurrentAssetSource: (file: string) => string | undefined; updateAssetIfChanged: (file: string, source: WebpackSourceLike, { compare, notifyUpdate, }?: { compare?: boolean | undefined; notifyUpdate?: boolean | undefined; }) => boolean; };