weapp-tailwindcss 3.2.0 → 3.3.0-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.
Files changed (60) hide show
  1. package/README.md +16 -18
  2. package/dist/bundlers/vite/index.d.ts +1 -1
  3. package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +1 -1
  4. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  5. package/dist/cli.js +12 -11
  6. package/dist/cli.mjs +6 -6
  7. package/dist/{constants-D-YMDg7M.js → constants-CFM1J-h1.js} +3 -3
  8. package/dist/{constants-CcqTvLgQ.mjs → constants-Dy2Dd3Fz.mjs} +3 -3
  9. package/dist/core.d.ts +1 -1
  10. package/dist/core.js +12 -13
  11. package/dist/core.mjs +12 -13
  12. package/dist/css-macro/index.js +2 -2
  13. package/dist/css-macro/index.mjs +2 -2
  14. package/dist/css-macro/postcss.js +8 -8
  15. package/dist/css-macro/postcss.mjs +8 -8
  16. package/dist/{defaults-Cpt1fUNP.mjs → defaults-BDivGN-J.mjs} +11 -10
  17. package/dist/{defaults-Mf4eWves.js → defaults-z7wUEh47.js} +11 -10
  18. package/dist/defaults.js +1 -1
  19. package/dist/defaults.mjs +1 -1
  20. package/dist/extractors/split.d.ts +1 -1
  21. package/dist/gulp.js +7 -5
  22. package/dist/gulp.mjs +7 -5
  23. package/dist/{index-BUSWfTII.mjs → index-BMv1aBKz.mjs} +13 -19
  24. package/dist/{index-Br8RI9kF.mjs → index-BPzIdybK.mjs} +96 -87
  25. package/dist/{index-DTZy_RpB.mjs → index-Bm-88xa7.mjs} +14 -16
  26. package/dist/{index-D39btBag.js → index-CeRMFNvT.js} +13 -19
  27. package/dist/{index-DCE5ieKW.js → index-DwZHOkK3.js} +96 -87
  28. package/dist/{index-BVkWxeac.js → index-oneQz6yy.js} +20 -22
  29. package/dist/index.js +9 -7
  30. package/dist/index.mjs +9 -7
  31. package/dist/js/handlers.d.ts +1 -1
  32. package/dist/mangle/index.d.ts +1 -1
  33. package/dist/{options-D_WlG4zX.js → options-DCor-e5I.js} +90 -83
  34. package/dist/{options-Bx4whTEl.mjs → options-SmfRHxH0.mjs} +92 -84
  35. package/dist/options.d.ts +1 -1
  36. package/dist/postcss/plugins/index.d.ts +2 -2
  37. package/dist/postcss/preflight.d.ts +1 -1
  38. package/dist/postcss/selectorParser.d.ts +1 -1
  39. package/dist/postcss/shared.d.ts +1 -1
  40. package/dist/postcss.js +2 -2
  41. package/dist/postcss.mjs +2 -2
  42. package/dist/replace.d.ts +1 -1
  43. package/dist/replace.js +3 -3
  44. package/dist/replace.mjs +3 -3
  45. package/dist/{shared-BX0VV-pr.mjs → shared-DbJl6i6a.mjs} +2 -2
  46. package/dist/{shared-BDew1Ric.js → shared-hzYeE1wX.js} +2 -2
  47. package/dist/tailwindcss/patcher.d.ts +4 -3
  48. package/dist/types.d.ts +10 -6
  49. package/dist/utils.d.ts +1 -1
  50. package/dist/{v5-CFnJIK3x.mjs → v5-CQUeTJ2W.mjs} +16 -22
  51. package/dist/{v5-8gu_iMbg.js → v5-ea_QoULz.js} +16 -22
  52. package/dist/vite.js +6 -5
  53. package/dist/vite.mjs +6 -5
  54. package/dist/webpack.js +6 -5
  55. package/dist/webpack.mjs +6 -5
  56. package/dist/webpack4.js +17 -22
  57. package/dist/webpack4.mjs +17 -22
  58. package/dist/wxml/shared.d.ts +1 -1
  59. package/dist/wxml/utils.d.ts +2 -2
  60. package/package.json +84 -82
package/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  <p align="center">
3
2
 
4
3
  <a href="https://weapp-tw.icebreaker.top">
@@ -21,15 +20,15 @@
21
20
  [![test](https://github.com/sonofmagic/weapp-tailwindcss/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/sonofmagic/weapp-tailwindcss/actions/workflows/test.yml)
22
21
  [![codecov](https://codecov.io/gh/sonofmagic/weapp-tailwindcss/branch/main/graph/badge.svg?token=zn05qXYznt)](https://codecov.io/gh/sonofmagic/weapp-tailwindcss)
23
22
 
23
+ > [!NOTE]
24
24
  > 降低开发维护成本,提升开发效率的 `小程序` `tailwindcss` 全方面解决方案
25
25
  >
26
- > 我的其他项目:
27
26
  > `Tailwindcss/Unocss UI` 生成提取器: [`IceStack`](https://ui.icebreaker.top/zh-CN) 已经发布,快来用它管理你的原子化`CSS` 组件吧!
28
27
 
29
28
  \[[国内部署的文档地址](https://weapp-tw.icebreaker.top)\] \| \[[备用Github Page](https://sonofmagic.github.io/weapp-tailwindcss/)\] \| \[[1.x文档]('./v1.md')\]
30
29
 
31
30
  - [特性](#特性)
32
- - [插件介绍](#插件介绍)
31
+ - [版本对应](#版本对应)
33
32
  - [安装与使用方式](#安装与使用方式)
34
33
  - [生态和解决方案](#生态和解决方案)
35
34
  - [常见问题](#常见问题)
@@ -42,7 +41,8 @@
42
41
  - [License](#license)
43
42
  - [Star History](#star-history)
44
43
  - [Related projects](#related-projects)
45
- - [CLI 工具](#cli-工具)
44
+ - [IceStack](#icestack)
45
+ - [weapp-ide-cli](#weapp-ide-cli)
46
46
  - [weapp-pandacss](#weapp-pandacss)
47
47
 
48
48
  ## 特性
@@ -51,19 +51,15 @@
51
51
  | --------------------------------------------------- | ----------------------------------------------- |
52
52
  | ![wepback+vite+gulp](./assets/weapp-tw-plugins.png) | ![frameworks](./assets/weapp-tw-frameworks.png) |
53
53
 
54
- 核心插件支持 `webpack`/`vite`/`gulp`进行打包,涵盖了市面上几乎所有的主流开发小程序的框架。
55
-
56
- 这些插件能够自动识别并精确处理所有 `tailwindcss` 的工具类来适配小程序环境。同时这些插件还有对`tailwindcss`生成的工具类名,进行压缩和混淆的能力。这个能力可以缩短`css`选择器的长度,减小生成样式的体积,同时让生产环境中的类名变得不可阅读。
57
-
58
- ### 插件介绍
54
+ 核心插件支持 `webpack`/`vite`/`gulp` 为基底的框架类小程序开发,涵盖了市面上几乎所有的主流的开发框架。
59
55
 
60
- 从 `weapp-tailwindcss/webpack` 导出的`UnifiedWebpackPluginV5` 是一个核心插件,所有使用 `webpack5` 进行打包的框架都可以使用它。
56
+ 同时也支持最原生的开发者工具创建的原生小程序应用。
61
57
 
62
- `weapp-tailwindcss/vite` 导出的`UnifiedViteWeappTailwindcssPlugin` 为 `vite` 专用插件,配置项和使用方式和 `webpack` 插件是一致的。
58
+ 这些插件能够自动识别并精确处理所有 `tailwindcss` 的工具类来适配小程序环境。
63
59
 
64
- 而我们的 `gulp` 插件方法,可以从 `weapp-tailwindcss/gulp` 导出。
60
+ ## 版本对应
65
61
 
66
- 目前,这些插件支持最新版本的 `tailwindcss v3.x.x` 版本和 `webpack5`,`vite` 和 `gulp`。
62
+ 目前,`weapp-tailwindcss` `2.x` 和 `3.x` 支持最新版本的 `tailwindcss v3.x.x` 版本和 `webpack5`,`webpack4`, `vite` 和 `gulp`。从 `3.2.0` 开始,`weapp-tailwindcss` 支持最原生的小程序开发方式。
67
63
 
68
64
  > 如果你还在使用 `tailwindcss@2` 版本,那你应该使用本插件的 `1.x`/`webpack4` 版本。另外请确保你的 `nodejs` 版本 `>=16.6.0`。目前低于 `16` 的长期维护版本(`偶数版本`) 都已经结束了生命周期,建议安装 `nodejs` 的 `LTS`版本,详见 [nodejs/release](https://github.com/nodejs/release)
69
65
 
@@ -83,11 +79,9 @@
83
79
 
84
80
  ## Tips
85
81
 
86
- 自从 `2.3.3` 版本开始,我发布了一个额外的包叫 `weapp-tailwindcss`,它和 `weapp-tailwindcss-webpack-plugin` 代码版本完全一致,且保持发布版本的同步。以后可以都去安装 `weapp-tailwindcss` 这个包,当然现在 `weapp-tailwindcss-webpack-plugin` 这个包也不会废弃,也会时刻保持版本的同步。
82
+ 前沿阅读: [What’s Tailwind Oxide Engine? The Next Evolution of Tailwind CSS](https://medium.com/@bomber.marek/whats-tailwind-oxide-engine-the-next-evolution-of-tailwind-css-32e7ef8e19a1)
87
83
 
88
- 为什么要这么做的原因,主要是因为 `weapp-tailwindcss-webpack-plugin` 这个名字,已经不适合描述现在这种,多插件并存的状态了,为了以后的发展改个名。
89
-
90
- 前沿阅读: [What’s Tailwind Oxide Engine? The Next Evolution of Tailwind CSS](https://medium.com/@bomber.marek/whats-tailwind-oxide-engine-the-next-evolution-of-tailwind-css-32e7ef8e19a1),未来 `tailwindcss` 会切换到这个引擎来大幅加快构建和运行速度,当然等它发布正式版本的时候,我也会尽可能第一时间去进行兼容新的引擎。
84
+ 未来 `tailwindcss@4` 会切换到这个引擎来大幅加快构建和运行速度,当然等它发布正式版本的时候,我也会尽可能第一时间去进行兼容新的引擎。
91
85
 
92
86
  ## Contribute
93
87
 
@@ -110,7 +104,11 @@
110
104
 
111
105
  ## Related projects
112
106
 
113
- ### CLI 工具
107
+ ### IceStack
108
+
109
+ [IceStack](https://github.com/sonofmagic/icestack): ❤️ IceStack, Web UI for Mobile, PC, open-source Css component library generator
110
+
111
+ ### weapp-ide-cli
114
112
 
115
113
  [weapp-ide-cli](https://github.com/sonofmagic/utils/tree/main/packages/weapp-ide-cli): 一个微信开发者工具命令行,快速方便的直接启动 ide 进行登录,开发,预览,上传代码等等功能。
116
114
 
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from 'vite';
2
- import { UserDefinedOptions } from "../../types";
2
+ import type { UserDefinedOptions } from "../../types";
3
3
  export declare function UnifiedViteWeappTailwindcssPlugin(options?: UserDefinedOptions): Plugin | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { Compiler } from 'webpack4';
2
- import type { AppType, UserDefinedOptions, InternalUserDefinedOptions, IBaseWebpackPlugin } from "../../../types";
2
+ import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from "../../../types";
3
3
  export declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
4
4
  options: InternalUserDefinedOptions;
5
5
  appType?: AppType;
@@ -1,5 +1,5 @@
1
1
  import type { Compiler } from 'webpack';
2
- import type { AppType, UserDefinedOptions, InternalUserDefinedOptions, IBaseWebpackPlugin } from "../../../types";
2
+ import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from "../../../types";
3
3
  export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
4
4
  options: InternalUserDefinedOptions;
5
5
  appType?: AppType;
package/dist/cli.js CHANGED
@@ -1,18 +1,19 @@
1
1
  'use strict';
2
2
 
3
+ var process = require('node:process');
3
4
  var semver = require('semver');
4
- var options = require('./options-D_WlG4zX.js');
5
- var index = require('./index-DCE5ieKW.js');
5
+ var options = require('./options-DCor-e5I.js');
6
+ var index = require('./index-DwZHOkK3.js');
6
7
  require('magic-string');
7
8
  require('./replace.js');
8
9
  require('@weapp-core/escape');
9
10
  require('@ast-core/escape');
10
- require('./shared-BDew1Ric.js');
11
+ require('./shared-hzYeE1wX.js');
11
12
  require('@weapp-core/regex');
12
13
  require('@babel/generator');
13
14
  require('@babel/traverse');
14
15
  require('@babel/parser');
15
- require('./defaults-Mf4eWves.js');
16
+ require('./defaults-z7wUEh47.js');
16
17
  require('./defu-Cdz2PomB.js');
17
18
  require('@babel/types');
18
19
  require('htmlparser2');
@@ -29,19 +30,19 @@ require('postcss-selector-parser');
29
30
 
30
31
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
31
32
 
33
+ var process__default = /*#__PURE__*/_interopDefaultCompat(process);
32
34
  var semver__default = /*#__PURE__*/_interopDefaultCompat(semver);
33
35
 
34
- process.title = 'node (weapp-tailwindcss)';
35
- const args = process.argv.slice(2);
36
- if (semver__default["default"].lt(process.versions.node, index.WEAPP_TW_REQUIRED_NODE_VERSION)) {
37
- console.error(`You are using Node.js ${process.versions.node}. For weapp-tailwindcss, Node.js version >= v${index.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`);
38
- process.exit(1);
36
+ process__default["default"].title = 'node (weapp-tailwindcss)';
37
+ const args = process__default["default"].argv.slice(2);
38
+ if (semver__default["default"].lt(process__default["default"].versions.node, index.WEAPP_TW_REQUIRED_NODE_VERSION)) {
39
+ console.error(`You are using Node.js ${process__default["default"].versions.node}. For weapp-tailwindcss, Node.js version >= v${index.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`);
40
+ process__default["default"].exit(1);
39
41
  }
40
42
  const command = args[0];
41
43
  if (command === 'patch') {
42
44
  const options$1 = options.getOptions();
43
- const patch = options.createPatch(options$1.supportCustomLengthUnitsPatch);
44
- patch();
45
+ options$1.patch();
45
46
  }
46
47
  else {
47
48
  try {
package/dist/cli.mjs CHANGED
@@ -1,16 +1,17 @@
1
+ import process from 'node:process';
1
2
  import semver from 'semver';
2
- import { g as getOptions, a as createPatch } from './options-Bx4whTEl.mjs';
3
- import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-Br8RI9kF.mjs';
3
+ import { g as getOptions } from './options-SmfRHxH0.mjs';
4
+ import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-BPzIdybK.mjs';
4
5
  import 'magic-string';
5
6
  import './replace.mjs';
6
7
  import '@weapp-core/escape';
7
8
  import '@ast-core/escape';
8
- import './shared-BX0VV-pr.mjs';
9
+ import './shared-DbJl6i6a.mjs';
9
10
  import '@weapp-core/regex';
10
11
  import '@babel/generator';
11
12
  import '@babel/traverse';
12
13
  import '@babel/parser';
13
- import './defaults-Cpt1fUNP.mjs';
14
+ import './defaults-BDivGN-J.mjs';
14
15
  import './defu-n46TJT6t.mjs';
15
16
  import '@babel/types';
16
17
  import 'htmlparser2';
@@ -34,8 +35,7 @@ if (semver.lt(process.versions.node, WEAPP_TW_REQUIRED_NODE_VERSION)) {
34
35
  const command = args[0];
35
36
  if (command === 'patch') {
36
37
  const options = getOptions();
37
- const patch = createPatch(options.supportCustomLengthUnitsPatch);
38
- patch();
38
+ options.patch();
39
39
  }
40
40
  else {
41
41
  try {
@@ -16,19 +16,19 @@ function normalComment(text) {
16
16
  function ifdef(text) {
17
17
  return {
18
18
  start: `#ifdef ${normalComment(text)}`,
19
- end: `#endif`
19
+ end: `#endif`,
20
20
  };
21
21
  }
22
22
  function ifndef(text) {
23
23
  return {
24
24
  start: `#ifndef ${normalComment(text)}`,
25
- end: `#endif`
25
+ end: `#endif`,
26
26
  };
27
27
  }
28
28
  function matchCustomPropertyFromValue(str, cb) {
29
29
  let arr;
30
30
  let index = 0;
31
- const regex = new RegExp('\\(\\s*' + queryKey + '\\s*:\\s*"([^)]*)"\\)', 'g');
31
+ const regex = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, 'g');
32
32
  while ((arr = regex.exec(str)) !== null) {
33
33
  cb(arr, index);
34
34
  index++;
@@ -14,19 +14,19 @@ function normalComment(text) {
14
14
  function ifdef(text) {
15
15
  return {
16
16
  start: `#ifdef ${normalComment(text)}`,
17
- end: `#endif`
17
+ end: `#endif`,
18
18
  };
19
19
  }
20
20
  function ifndef(text) {
21
21
  return {
22
22
  start: `#ifndef ${normalComment(text)}`,
23
- end: `#endif`
23
+ end: `#endif`,
24
24
  };
25
25
  }
26
26
  function matchCustomPropertyFromValue(str, cb) {
27
27
  let arr;
28
28
  let index = 0;
29
- const regex = new RegExp('\\(\\s*' + queryKey + '\\s*:\\s*"([^)]*)"\\)', 'g');
29
+ const regex = new RegExp(`\\(\\s*${queryKey}\\s*:\\s*"([^)]*)"\\)`, 'g');
30
30
  while ((arr = regex.exec(str)) !== null) {
31
31
  cb(arr, index);
32
32
  index++;
package/dist/core.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UserDefinedOptions } from "./types";
1
+ import type { UserDefinedOptions } from "./types";
2
2
  export declare function createContext(options?: UserDefinedOptions): {
3
3
  transformWxss: (rawCss: string) => Promise<string>;
4
4
  transformWxml: (rawWxml: string) => Promise<string>;
package/dist/core.js CHANGED
@@ -2,27 +2,28 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-D_WlG4zX.js');
5
+ var options = require('./options-DCor-e5I.js');
6
6
  require('magic-string');
7
7
  require('./replace.js');
8
8
  require('@weapp-core/escape');
9
9
  require('@ast-core/escape');
10
- require('./shared-BDew1Ric.js');
10
+ require('./shared-hzYeE1wX.js');
11
11
  require('@weapp-core/regex');
12
12
  require('@babel/generator');
13
13
  require('@babel/traverse');
14
14
  require('@babel/parser');
15
- require('./defaults-Mf4eWves.js');
15
+ require('./defaults-z7wUEh47.js');
16
16
  require('./defu-Cdz2PomB.js');
17
17
  require('@babel/types');
18
18
  require('htmlparser2');
19
19
  require('postcss');
20
- require('./index-DCE5ieKW.js');
20
+ require('./index-DwZHOkK3.js');
21
21
  require('@csstools/postcss-is-pseudo-class');
22
22
  require('postcss-rem-to-responsive-pixel');
23
23
  require('postcss-selector-parser');
24
24
  require('node:path');
25
25
  require('node:fs');
26
+ require('node:process');
26
27
  require('semver');
27
28
  require('tailwindcss-patch');
28
29
  require('@tailwindcss-mangle/shared');
@@ -34,37 +35,35 @@ function createContext(options$1 = {}) {
34
35
  const { templateHandler, styleHandler, patch, jsHandler, tailwindcssBasedir } = opts;
35
36
  let runtimeSet = new Set();
36
37
  patch === null || patch === void 0 ? void 0 : patch();
37
- const twPatcher = options.createTailwindcssPatcher();
38
+ const twPatcher = options.createTailwindcssPatcher(tailwindcssBasedir);
38
39
  function transformWxss(rawCss) {
39
40
  return options.__awaiter(this, void 0, void 0, function* () {
40
41
  const code = yield styleHandler(rawCss, {
41
- isMainChunk: true
42
+ isMainChunk: true,
42
43
  });
43
44
  return code;
44
45
  });
45
46
  }
46
47
  function transformJs(rawJs_1) {
47
48
  return options.__awaiter(this, arguments, void 0, function* (rawJs, options = {}) {
48
- runtimeSet =
49
- options && options.runtimeSet
49
+ runtimeSet
50
+ = options && options.runtimeSet
50
51
  ? options.runtimeSet
51
- : twPatcher.getClassSet({
52
- basedir: tailwindcssBasedir
53
- });
52
+ : twPatcher.getClassSet();
54
53
  const { code } = yield jsHandler(rawJs, runtimeSet);
55
54
  return code;
56
55
  });
57
56
  }
58
57
  function transformWxml(rawWxml) {
59
58
  const code = templateHandler(rawWxml, {
60
- runtimeSet
59
+ runtimeSet,
61
60
  });
62
61
  return code;
63
62
  }
64
63
  return {
65
64
  transformWxss,
66
65
  transformWxml,
67
- transformJs
66
+ transformJs,
68
67
  };
69
68
  }
70
69
 
package/dist/core.mjs CHANGED
@@ -1,24 +1,25 @@
1
- import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Bx4whTEl.mjs';
1
+ import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-SmfRHxH0.mjs';
2
2
  import 'magic-string';
3
3
  import './replace.mjs';
4
4
  import '@weapp-core/escape';
5
5
  import '@ast-core/escape';
6
- import './shared-BX0VV-pr.mjs';
6
+ import './shared-DbJl6i6a.mjs';
7
7
  import '@weapp-core/regex';
8
8
  import '@babel/generator';
9
9
  import '@babel/traverse';
10
10
  import '@babel/parser';
11
- import './defaults-Cpt1fUNP.mjs';
11
+ import './defaults-BDivGN-J.mjs';
12
12
  import './defu-n46TJT6t.mjs';
13
13
  import '@babel/types';
14
14
  import 'htmlparser2';
15
15
  import 'postcss';
16
- import './index-Br8RI9kF.mjs';
16
+ import './index-BPzIdybK.mjs';
17
17
  import '@csstools/postcss-is-pseudo-class';
18
18
  import 'postcss-rem-to-responsive-pixel';
19
19
  import 'postcss-selector-parser';
20
20
  import 'node:path';
21
21
  import 'node:fs';
22
+ import 'node:process';
22
23
  import 'semver';
23
24
  import 'tailwindcss-patch';
24
25
  import '@tailwindcss-mangle/shared';
@@ -30,37 +31,35 @@ function createContext(options = {}) {
30
31
  const { templateHandler, styleHandler, patch, jsHandler, tailwindcssBasedir } = opts;
31
32
  let runtimeSet = new Set();
32
33
  patch === null || patch === void 0 ? void 0 : patch();
33
- const twPatcher = createTailwindcssPatcher();
34
+ const twPatcher = createTailwindcssPatcher(tailwindcssBasedir);
34
35
  function transformWxss(rawCss) {
35
36
  return __awaiter(this, void 0, void 0, function* () {
36
37
  const code = yield styleHandler(rawCss, {
37
- isMainChunk: true
38
+ isMainChunk: true,
38
39
  });
39
40
  return code;
40
41
  });
41
42
  }
42
43
  function transformJs(rawJs_1) {
43
44
  return __awaiter(this, arguments, void 0, function* (rawJs, options = {}) {
44
- runtimeSet =
45
- options && options.runtimeSet
45
+ runtimeSet
46
+ = options && options.runtimeSet
46
47
  ? options.runtimeSet
47
- : twPatcher.getClassSet({
48
- basedir: tailwindcssBasedir
49
- });
48
+ : twPatcher.getClassSet();
50
49
  const { code } = yield jsHandler(rawJs, runtimeSet);
51
50
  return code;
52
51
  });
53
52
  }
54
53
  function transformWxml(rawWxml) {
55
54
  const code = templateHandler(rawWxml, {
56
- runtimeSet
55
+ runtimeSet,
57
56
  });
58
57
  return code;
59
58
  }
60
59
  return {
61
60
  transformWxss,
62
61
  transformWxml,
63
- transformJs
62
+ transformJs,
64
63
  };
65
64
  }
66
65
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var plugin = require('tailwindcss/plugin');
4
- var constants = require('../constants-D-YMDg7M.js');
4
+ var constants = require('../constants-CFM1J-h1.js');
5
5
  var defu = require('../defu-Cdz2PomB.js');
6
6
 
7
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -11,7 +11,7 @@ var plugin__default = /*#__PURE__*/_interopDefaultCompat(plugin);
11
11
  var index = plugin__default["default"].withOptions((options) => {
12
12
  const { dynamic: dynamicMode, variantsMap } = defu.defu(options, {
13
13
  dynamic: true,
14
- variantsMap: {}
14
+ variantsMap: {},
15
15
  });
16
16
  return ({ matchVariant, addVariant }) => {
17
17
  if (dynamicMode) {
@@ -1,11 +1,11 @@
1
1
  import plugin from 'tailwindcss/plugin';
2
- import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-CcqTvLgQ.mjs';
2
+ import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-Dy2Dd3Fz.mjs';
3
3
  import { d as defu } from '../defu-n46TJT6t.mjs';
4
4
 
5
5
  var index = plugin.withOptions((options) => {
6
6
  const { dynamic: dynamicMode, variantsMap } = defu(options, {
7
7
  dynamic: true,
8
- variantsMap: {}
8
+ variantsMap: {},
9
9
  });
10
10
  return ({ matchVariant, addVariant }) => {
11
11
  if (dynamicMode) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var constants = require('../constants-D-YMDg7M.js');
3
+ var constants = require('../constants-CFM1J-h1.js');
4
4
 
5
5
  const creator = () => {
6
6
  return {
@@ -21,17 +21,17 @@ const creator = () => {
21
21
  atRule.replaceWith([
22
22
  helper.comment({
23
23
  raws: {
24
- before: '\n'
24
+ before: '\n',
25
25
  },
26
- text: comment.start
26
+ text: comment.start,
27
27
  }),
28
28
  ...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
29
29
  helper.comment({
30
30
  raws: {
31
- before: '\n'
31
+ before: '\n',
32
32
  },
33
- text: comment.end
34
- })
33
+ text: comment.end,
34
+ }),
35
35
  ]);
36
36
  }
37
37
  }
@@ -41,9 +41,9 @@ const creator = () => {
41
41
  comment.raws.left = ' ';
42
42
  comment.raws.right = ' ';
43
43
  }
44
- }
44
+ },
45
45
  };
46
- }
46
+ },
47
47
  };
48
48
  };
49
49
  creator.postcss = true;
@@ -1,4 +1,4 @@
1
- import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-CcqTvLgQ.mjs';
1
+ import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-Dy2Dd3Fz.mjs';
2
2
 
3
3
  const creator = () => {
4
4
  return {
@@ -19,17 +19,17 @@ const creator = () => {
19
19
  atRule.replaceWith([
20
20
  helper.comment({
21
21
  raws: {
22
- before: '\n'
22
+ before: '\n',
23
23
  },
24
- text: comment.start
24
+ text: comment.start,
25
25
  }),
26
26
  ...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
27
27
  helper.comment({
28
28
  raws: {
29
- before: '\n'
29
+ before: '\n',
30
30
  },
31
- text: comment.end
32
- })
31
+ text: comment.end,
32
+ }),
33
33
  ]);
34
34
  }
35
35
  }
@@ -39,9 +39,9 @@ const creator = () => {
39
39
  comment.raws.left = ' ';
40
40
  comment.raws.right = ' ';
41
41
  }
42
- }
42
+ },
43
43
  };
44
- }
44
+ },
45
45
  };
46
46
  };
47
47
  creator.postcss = true;
@@ -5,7 +5,7 @@ import '@ast-core/escape';
5
5
  function isMap(value) {
6
6
  return Object.prototype.toString.call(value) === '[object Map]';
7
7
  }
8
- const noop = () => { };
8
+ function noop() { }
9
9
  function groupBy(arr, cb) {
10
10
  if (!Array.isArray(arr)) {
11
11
  throw new TypeError('expected an array for first argument');
@@ -55,8 +55,8 @@ const defuOverrideArray = createDefu((obj, key, value) => {
55
55
  });
56
56
 
57
57
  const defaultOptions = {
58
- cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
59
- htmlMatcher: (file) => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
58
+ cssMatcher: file => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
59
+ htmlMatcher: file => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
60
60
  jsMatcher: (file) => {
61
61
  if (file.includes('node_modules')) {
62
62
  return false;
@@ -101,7 +101,7 @@ const defaultOptions = {
101
101
  'box-sizing': 'border-box',
102
102
  'border-width': '0',
103
103
  'border-style': 'solid',
104
- 'border-color': 'currentColor'
104
+ 'border-color': 'currentColor',
105
105
  },
106
106
  disabled: false,
107
107
  customRuleCallback: noop,
@@ -118,12 +118,12 @@ const defaultOptions = {
118
118
  lengthUnitsFilePath: 'lib/util/dataTypes.js',
119
119
  packageName: 'tailwindcss',
120
120
  variableName: 'lengthUnits',
121
- overwrite: true
122
- }
121
+ overwrite: true,
122
+ },
123
123
  },
124
124
  appType: undefined,
125
125
  arbitraryValues: {
126
- allowDoubleQuotes: false
126
+ allowDoubleQuotes: false,
127
127
  },
128
128
  cssChildCombinatorReplaceValue: ['view'],
129
129
  inlineWxs: false,
@@ -137,12 +137,13 @@ const defaultOptions = {
137
137
  disabledDefaultTemplateHandler: false,
138
138
  cssSelectorReplacement: {
139
139
  root: 'page',
140
- universal: ['view', 'text']
140
+ universal: ['view', 'text'],
141
141
  },
142
142
  babelParserOptions: {
143
- sourceType: 'unambiguous'
143
+ sourceType: 'unambiguous',
144
144
  },
145
- postcssOptions: {}
145
+ postcssOptions: {},
146
+ cssRemoveHoverPseudoClass: true,
146
147
  };
147
148
 
148
149
  export { defaultOptions as a, defuOverrideArray as d, getGroupedEntries as g, isMap as i, noop as n, removeExt as r };
@@ -7,7 +7,7 @@ require('@ast-core/escape');
7
7
  function isMap(value) {
8
8
  return Object.prototype.toString.call(value) === '[object Map]';
9
9
  }
10
- const noop = () => { };
10
+ function noop() { }
11
11
  function groupBy(arr, cb) {
12
12
  if (!Array.isArray(arr)) {
13
13
  throw new TypeError('expected an array for first argument');
@@ -57,8 +57,8 @@ const defuOverrideArray = defu.createDefu((obj, key, value) => {
57
57
  });
58
58
 
59
59
  const defaultOptions = {
60
- cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
61
- htmlMatcher: (file) => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
60
+ cssMatcher: file => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
61
+ htmlMatcher: file => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
62
62
  jsMatcher: (file) => {
63
63
  if (file.includes('node_modules')) {
64
64
  return false;
@@ -103,7 +103,7 @@ const defaultOptions = {
103
103
  'box-sizing': 'border-box',
104
104
  'border-width': '0',
105
105
  'border-style': 'solid',
106
- 'border-color': 'currentColor'
106
+ 'border-color': 'currentColor',
107
107
  },
108
108
  disabled: false,
109
109
  customRuleCallback: noop,
@@ -120,12 +120,12 @@ const defaultOptions = {
120
120
  lengthUnitsFilePath: 'lib/util/dataTypes.js',
121
121
  packageName: 'tailwindcss',
122
122
  variableName: 'lengthUnits',
123
- overwrite: true
124
- }
123
+ overwrite: true,
124
+ },
125
125
  },
126
126
  appType: undefined,
127
127
  arbitraryValues: {
128
- allowDoubleQuotes: false
128
+ allowDoubleQuotes: false,
129
129
  },
130
130
  cssChildCombinatorReplaceValue: ['view'],
131
131
  inlineWxs: false,
@@ -139,12 +139,13 @@ const defaultOptions = {
139
139
  disabledDefaultTemplateHandler: false,
140
140
  cssSelectorReplacement: {
141
141
  root: 'page',
142
- universal: ['view', 'text']
142
+ universal: ['view', 'text'],
143
143
  },
144
144
  babelParserOptions: {
145
- sourceType: 'unambiguous'
145
+ sourceType: 'unambiguous',
146
146
  },
147
- postcssOptions: {}
147
+ postcssOptions: {},
148
+ cssRemoveHoverPseudoClass: true,
148
149
  };
149
150
 
150
151
  exports.defaultOptions = defaultOptions;
package/dist/defaults.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var defaults = require('./defaults-Mf4eWves.js');
5
+ var defaults = require('./defaults-z7wUEh47.js');
6
6
  require('@weapp-core/escape');
7
7
  require('@ast-core/escape');
8
8
  require('./defu-Cdz2PomB.js');
package/dist/defaults.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { a as defaultOptions } from './defaults-Cpt1fUNP.mjs';
1
+ export { a as defaultOptions } from './defaults-BDivGN-J.mjs';
2
2
  import '@weapp-core/escape';
3
3
  import '@ast-core/escape';
4
4
  import './defu-n46TJT6t.mjs';