weapp-tailwindcss
Version:
把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!
39 lines (34 loc) • 1.24 kB
JavaScript
Object.defineProperty(exports, "__esModule", {value: true});
var _chunkA7T5CY7Mjs = require('./chunk-A7T5CY7M.js');
require('./chunk-PLMJW644.js');
require('./chunk-IS2CB3US.js');
require('./chunk-O335YLYH.js');
require('./chunk-L5OJYGRB.js');
// src/core.ts
var _shared = require('@weapp-tailwindcss/shared');
function createContext(options = {}) {
const opts = _chunkA7T5CY7Mjs.getCompilerContext.call(void 0, options);
const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
let runtimeSet = /* @__PURE__ */ new Set();
twPatcher.patch();
function transformWxss(rawCss, options2) {
return styleHandler(rawCss, _shared.defuOverrideArray.call(void 0, options2, {
isMainChunk: true
}));
}
async function transformJs(rawJs, options2 = {}) {
runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await twPatcher.getClassSet();
return await jsHandler(rawJs, runtimeSet, options2);
}
function transformWxml(rawWxml, options2) {
return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
runtimeSet
}));
}
return {
transformWxss,
transformWxml,
transformJs
};
}
exports.createContext = createContext;
;