weapp-tailwindcss
Version:
把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!
30 lines (27 loc) • 824 B
JavaScript
import {
createPatchTargetRecorder,
createTailwindPatchPromise
} from "./chunk-WGBJY2H3.mjs";
import {
logger
} from "./chunk-ZE7JKKFT.mjs";
// src/tailwindcss/recorder.ts
function setupPatchRecorder(patcher, baseDir, options) {
const recorder = createPatchTargetRecorder(baseDir, patcher, options);
if (recorder?.message && options?.logMessage !== false) {
const prefix = options?.messagePrefix ? `${options.messagePrefix} ` : "";
logger.info("%s%s", prefix, recorder.message);
}
const onPatchCompleted = recorder?.onPatched ? async () => {
await recorder.onPatched();
} : void 0;
const patchPromise = patcher ? createTailwindPatchPromise(patcher, onPatchCompleted) : Promise.resolve();
return {
recorder,
patchPromise,
onPatchCompleted
};
}
export {
setupPatchRecorder
};