@weapp-tailwindcss/postcss 2.1.5 → 2.1.6-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ var _shared = require('@weapp-tailwindcss/shared');
4
4
  var htmlTags = ["html", "body", "a", "audio", "button", "canvas", "form", "iframe", "img", "input", "label", "progress", "select", "slot", "textarea", "video", "abbr", "area", "b", "bdi", "big", "br", "cite", "code", "data", "datalist", "del", "dfn", "em", "i", "ins", "kbd", "map", "mark", "meter", "output", "picture", "q", "s", "samp", "small", "span", "strong", "sub", "sup", "td", "template", "th", "time", "tt", "u", "var", "wbr", "address", "article", "aside", "blockquote", "caption", "dd", "details", "dialog", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "legend", "li", "main", "nav", "ol", "p", "pre", "section", "summary", "table", "tbody", "tfoot", "thead", "tr", "ul", "svg"];
5
5
  var miniAppTags = ["cover-image", "cover-view", "match-media", "movable-area", "movable-view", "page-container", "scroll-view", "share-element", "swiper", "swiper-item", "view", "icon", "progress", "rich-text", "text", "button", "checkbox", "checkbox-group", "editor", "form", "input", "keyboard-accessory", "label", "picker", "picker-view", "picker-view-column", "radio", "radio-group", "slider", "switch", "textarea", "functional-page-navigator", "navigator", "audio", "camera", "image", "live-player", "live-pusher", "video", "voip-room", "map", "canvas", "web-view", "ad", "ad-custom", "official-account", "open-data", "navigation-bar", "page-meta"];
6
6
  var tags2Rgx = (tags = []) => new RegExp(`(^| |\\+|,|~|>|\\n)(${tags.join("|")})\\b(?=$| |\\.|\\+|,|~|:|\\[)`, "g");
7
+ var UNIVERSAL_SELECTOR_RE = /(?:^| )\*(?![=/*])/;
7
8
  var postcssHtmlTransform = (opts = {}) => {
8
9
  const options = _shared.defu.call(void 0, opts, {
9
10
  platform: _process2.default.env.TARO_ENV
@@ -27,7 +28,7 @@ var postcssHtmlTransform = (opts = {}) => {
27
28
  default: {
28
29
  const selector = tags2Rgx(htmlTags);
29
30
  walkRules = (rule) => {
30
- if (options.removeUniversal && /(?:^| )\*(?![=/*])/.test(rule.selector)) {
31
+ if (options.removeUniversal && UNIVERSAL_SELECTOR_RE.test(rule.selector)) {
31
32
  rule.remove();
32
33
  return;
33
34
  }
@@ -4,6 +4,7 @@ import { defu } from "@weapp-tailwindcss/shared";
4
4
  var htmlTags = ["html", "body", "a", "audio", "button", "canvas", "form", "iframe", "img", "input", "label", "progress", "select", "slot", "textarea", "video", "abbr", "area", "b", "bdi", "big", "br", "cite", "code", "data", "datalist", "del", "dfn", "em", "i", "ins", "kbd", "map", "mark", "meter", "output", "picture", "q", "s", "samp", "small", "span", "strong", "sub", "sup", "td", "template", "th", "time", "tt", "u", "var", "wbr", "address", "article", "aside", "blockquote", "caption", "dd", "details", "dialog", "div", "dl", "dt", "fieldset", "figcaption", "figure", "footer", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "legend", "li", "main", "nav", "ol", "p", "pre", "section", "summary", "table", "tbody", "tfoot", "thead", "tr", "ul", "svg"];
5
5
  var miniAppTags = ["cover-image", "cover-view", "match-media", "movable-area", "movable-view", "page-container", "scroll-view", "share-element", "swiper", "swiper-item", "view", "icon", "progress", "rich-text", "text", "button", "checkbox", "checkbox-group", "editor", "form", "input", "keyboard-accessory", "label", "picker", "picker-view", "picker-view-column", "radio", "radio-group", "slider", "switch", "textarea", "functional-page-navigator", "navigator", "audio", "camera", "image", "live-player", "live-pusher", "video", "voip-room", "map", "canvas", "web-view", "ad", "ad-custom", "official-account", "open-data", "navigation-bar", "page-meta"];
6
6
  var tags2Rgx = (tags = []) => new RegExp(`(^| |\\+|,|~|>|\\n)(${tags.join("|")})\\b(?=$| |\\.|\\+|,|~|:|\\[)`, "g");
7
+ var UNIVERSAL_SELECTOR_RE = /(?:^| )\*(?![=/*])/;
7
8
  var postcssHtmlTransform = (opts = {}) => {
8
9
  const options = defu(opts, {
9
10
  platform: process.env.TARO_ENV
@@ -27,7 +28,7 @@ var postcssHtmlTransform = (opts = {}) => {
27
28
  default: {
28
29
  const selector = tags2Rgx(htmlTags);
29
30
  walkRules = (rule) => {
30
- if (options.removeUniversal && /(?:^| )\*(?![=/*])/.test(rule.selector)) {
31
+ if (options.removeUniversal && UNIVERSAL_SELECTOR_RE.test(rule.selector)) {
31
32
  rule.remove();
32
33
  return;
33
34
  }