UNPKG

weapp-tailwindcss

Version:

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

37 lines (36 loc) 2.3 kB
import type { Plugin, ResolvedConfig } from 'vite'; import type { ViteFrameworkName } from '../../framework-selector.js'; import type { createViteRuntimeClassSet } from '../runtime-class-set.js'; import type { ViteFrameworkCssPipelineStrategy, ViteFrameworkExtraPluginPlatform, ViteFrameworkRuntimeFeatureContext } from './framework-strategy.js'; import type { getCompilerContext } from '../../../context/index.js'; import type { toCustomAttributesEntities } from '../../../context/custom-attributes.js'; import type { ViteStyleInjectorDelegateFactory } from '../../../style-injector/internal.js'; import type { InternalUserDefinedOptions, UserDefinedOptions } from '../../../types/index.js'; export interface WeappTailwindcssVitePlugin { name: string; [hook: string]: any; } export interface ViteFrameworkBranchContext { frameworkName: ViteFrameworkName; adaptWatchCssBeforeFrameworkCache?: boolean; createExtraPlugins?: (context: ViteFrameworkExtraPluginContext) => Plugin[]; cssPipelineStrategy?: ViteFrameworkCssPipelineStrategy; getExtraPluginPlatform?: () => ViteFrameworkExtraPluginPlatform; styleInjectorDelegate: ViteStyleInjectorDelegateFactory; isRuntimeClassSetFeatureEnabled?: (context: ViteFrameworkRuntimeFeatureContext) => boolean; } export interface ViteFrameworkExtraPluginContext { customAttributesEntities: ReturnType<typeof toCustomAttributesEntities>; disabledDefaultTemplateHandler: boolean | undefined; ensureRuntimeClassSet: (...args: any[]) => Promise<Set<string>>; generateCss: (...args: any[]) => Promise<string | undefined>; getResolvedConfig: () => ResolvedConfig | undefined; isEnabled: () => boolean; isIosPlatform: boolean; jsHandler: ReturnType<typeof getCompilerContext>['jsHandler']; mainCssChunkMatcher: ReturnType<typeof getCompilerContext>['mainCssChunkMatcher']; runtimeState: ReturnType<typeof createViteRuntimeClassSet>['runtimeState']; styleHandler: ReturnType<typeof getCompilerContext>['styleHandler']; uniAppX: ReturnType<typeof getCompilerContext>['uniAppX']; } export declare function createViteFrameworkPlugins(options: (UserDefinedOptions | InternalUserDefinedOptions) | undefined, frameworkBranch: ViteFrameworkBranchContext): WeappTailwindcssVitePlugin[] | undefined;