UNPKG

weapp-tailwindcss

Version:

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

46 lines (36 loc) 1.28 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/utils/index.ts var _shared = require('@weapp-tailwindcss/shared'); // src/utils/hbuilderx.ts var _path = require('path'); var _path2 = _interopRequireDefault(_path); var _process = require('process'); var _process2 = _interopRequireDefault(_process); // src/utils/index.ts function classifyEntry(filename, options) { if (options.cssMatcher(filename)) { return "css"; } if (options.htmlMatcher(filename)) { return "html"; } if (options.jsMatcher(filename) || options.wxsMatcher(filename)) { return "js"; } return "other"; } function createEmptyGroups() { return { css: [], html: [], js: [], other: [] }; } function getGroupedEntries(entries, options) { const groups = createEmptyGroups(); for (const entry of entries) { const [filename] = entry; const group = classifyEntry(filename, options); groups[group].push(entry); } return groups; } exports.defu = _shared.defu; exports.defuOverrideArray = _shared.defuOverrideArray; exports.isMap = _shared.isMap; exports.noop = _shared.noop; exports.getGroupedEntries = getGroupedEntries;