weapp-tailwindcss 3.2.0-alpha.9 → 3.2.1
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.
- package/README.md +16 -18
- package/dist/cli.js +3 -3
- package/dist/cli.mjs +3 -3
- package/dist/core.js +3 -3
- package/dist/core.mjs +3 -3
- package/dist/{defaults-Mf4eWves.js → defaults-CGBcgdIr.js} +2 -1
- package/dist/{defaults-Cpt1fUNP.mjs → defaults-DOGbAFEj.mjs} +2 -1
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +4 -4
- package/dist/{index-DCE5ieKW.js → index-6BUjj8Rl.js} +15 -6
- package/dist/{index-BVkWxeac.js → index-BpY7tq3j.js} +1 -1
- package/dist/{index-Br8RI9kF.mjs → index-DC60ES8u.mjs} +15 -6
- package/dist/{index-DTZy_RpB.mjs → index-EnQF5WiI.mjs} +1 -1
- package/dist/{index-BUSWfTII.mjs → index-UGtfFwsf.mjs} +3 -6
- package/dist/{index-D39btBag.js → index-iiM-deHl.js} +3 -6
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/dist/{options-D_WlG4zX.js → options-BjZGMFOk.js} +21 -20
- package/dist/{options-Bx4whTEl.mjs → options-D1IYbX_E.mjs} +21 -20
- package/dist/options.d.ts +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/{v5-CFnJIK3x.mjs → v5-C6FTqEeL.mjs} +3 -6
- package/dist/{v5-8gu_iMbg.js → v5-DA4DSMKO.js} +3 -6
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +3 -6
- package/dist/webpack4.mjs +3 -6
- package/package.json +12 -12
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
|
[](https://github.com/sonofmagic/weapp-tailwindcss/actions/workflows/test.yml)
|
|
22
21
|
[](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
|
-
- [
|
|
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
|
|  |  |
|
|
53
53
|
|
|
54
|
-
核心插件支持 `webpack`/`vite`/`gulp
|
|
55
|
-
|
|
56
|
-
这些插件能够自动识别并精确处理所有 `tailwindcss` 的工具类来适配小程序环境。同时这些插件还有对`tailwindcss`生成的工具类名,进行压缩和混淆的能力。这个能力可以缩短`css`选择器的长度,减小生成样式的体积,同时让生产环境中的类名变得不可阅读。
|
|
57
|
-
|
|
58
|
-
### 插件介绍
|
|
54
|
+
核心插件支持 `webpack`/`vite`/`gulp` 为基底的框架类小程序开发,涵盖了市面上几乎所有的主流的开发框架。
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
同时也支持最原生的开发者工具创建的原生小程序应用。
|
|
61
57
|
|
|
62
|
-
|
|
58
|
+
这些插件能够自动识别并精确处理所有 `tailwindcss` 的工具类来适配小程序环境。
|
|
63
59
|
|
|
64
|
-
|
|
60
|
+
## 版本对应
|
|
65
61
|
|
|
66
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
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
|
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var semver = require('semver');
|
|
4
|
-
var options = require('./options-
|
|
5
|
-
var index = require('./index-
|
|
4
|
+
var options = require('./options-BjZGMFOk.js');
|
|
5
|
+
var index = require('./index-6BUjj8Rl.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
|
@@ -12,7 +12,7 @@ require('@weapp-core/regex');
|
|
|
12
12
|
require('@babel/generator');
|
|
13
13
|
require('@babel/traverse');
|
|
14
14
|
require('@babel/parser');
|
|
15
|
-
require('./defaults-
|
|
15
|
+
require('./defaults-CGBcgdIr.js');
|
|
16
16
|
require('./defu-Cdz2PomB.js');
|
|
17
17
|
require('@babel/types');
|
|
18
18
|
require('htmlparser2');
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
|
-
import { g as getOptions, a as createPatch } from './options-
|
|
3
|
-
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-
|
|
2
|
+
import { g as getOptions, a as createPatch } from './options-D1IYbX_E.mjs';
|
|
3
|
+
import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-DC60ES8u.mjs';
|
|
4
4
|
import 'magic-string';
|
|
5
5
|
import './replace.mjs';
|
|
6
6
|
import '@weapp-core/escape';
|
|
@@ -10,7 +10,7 @@ import '@weapp-core/regex';
|
|
|
10
10
|
import '@babel/generator';
|
|
11
11
|
import '@babel/traverse';
|
|
12
12
|
import '@babel/parser';
|
|
13
|
-
import './defaults-
|
|
13
|
+
import './defaults-DOGbAFEj.mjs';
|
|
14
14
|
import './defu-n46TJT6t.mjs';
|
|
15
15
|
import '@babel/types';
|
|
16
16
|
import 'htmlparser2';
|
package/dist/core.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var options = require('./options-
|
|
5
|
+
var options = require('./options-BjZGMFOk.js');
|
|
6
6
|
require('magic-string');
|
|
7
7
|
require('./replace.js');
|
|
8
8
|
require('@weapp-core/escape');
|
|
@@ -12,12 +12,12 @@ require('@weapp-core/regex');
|
|
|
12
12
|
require('@babel/generator');
|
|
13
13
|
require('@babel/traverse');
|
|
14
14
|
require('@babel/parser');
|
|
15
|
-
require('./defaults-
|
|
15
|
+
require('./defaults-CGBcgdIr.js');
|
|
16
16
|
require('./defu-Cdz2PomB.js');
|
|
17
17
|
require('@babel/types');
|
|
18
18
|
require('htmlparser2');
|
|
19
19
|
require('postcss');
|
|
20
|
-
require('./index-
|
|
20
|
+
require('./index-6BUjj8Rl.js');
|
|
21
21
|
require('@csstools/postcss-is-pseudo-class');
|
|
22
22
|
require('postcss-rem-to-responsive-pixel');
|
|
23
23
|
require('postcss-selector-parser');
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D1IYbX_E.mjs';
|
|
2
2
|
import 'magic-string';
|
|
3
3
|
import './replace.mjs';
|
|
4
4
|
import '@weapp-core/escape';
|
|
@@ -8,12 +8,12 @@ import '@weapp-core/regex';
|
|
|
8
8
|
import '@babel/generator';
|
|
9
9
|
import '@babel/traverse';
|
|
10
10
|
import '@babel/parser';
|
|
11
|
-
import './defaults-
|
|
11
|
+
import './defaults-DOGbAFEj.mjs';
|
|
12
12
|
import './defu-n46TJT6t.mjs';
|
|
13
13
|
import '@babel/types';
|
|
14
14
|
import 'htmlparser2';
|
|
15
15
|
import 'postcss';
|
|
16
|
-
import './index-
|
|
16
|
+
import './index-DC60ES8u.mjs';
|
|
17
17
|
import '@csstools/postcss-is-pseudo-class';
|
|
18
18
|
import 'postcss-rem-to-responsive-pixel';
|
|
19
19
|
import 'postcss-selector-parser';
|
|
@@ -142,7 +142,8 @@ const defaultOptions = {
|
|
|
142
142
|
babelParserOptions: {
|
|
143
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 };
|
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-
|
|
5
|
+
var defaults = require('./defaults-CGBcgdIr.js');
|
|
6
6
|
require('@weapp-core/escape');
|
|
7
7
|
require('@ast-core/escape');
|
|
8
8
|
require('./defu-Cdz2PomB.js');
|
package/dist/defaults.mjs
CHANGED
package/dist/gulp.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('./options-
|
|
5
|
+
var index = require('./index-BpY7tq3j.js');
|
|
6
|
+
require('./options-BjZGMFOk.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -13,12 +13,12 @@ require('@weapp-core/regex');
|
|
|
13
13
|
require('@babel/generator');
|
|
14
14
|
require('@babel/traverse');
|
|
15
15
|
require('@babel/parser');
|
|
16
|
-
require('./defaults-
|
|
16
|
+
require('./defaults-CGBcgdIr.js');
|
|
17
17
|
require('./defu-Cdz2PomB.js');
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-6BUjj8Rl.js');
|
|
22
22
|
require('@csstools/postcss-is-pseudo-class');
|
|
23
23
|
require('postcss-rem-to-responsive-pixel');
|
|
24
24
|
require('postcss-selector-parser');
|
package/dist/gulp.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as createPlugins } from './index-
|
|
2
|
-
import './options-
|
|
1
|
+
export { c as createPlugins } from './index-EnQF5WiI.mjs';
|
|
2
|
+
import './options-D1IYbX_E.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -9,12 +9,12 @@ import '@weapp-core/regex';
|
|
|
9
9
|
import '@babel/generator';
|
|
10
10
|
import '@babel/traverse';
|
|
11
11
|
import '@babel/parser';
|
|
12
|
-
import './defaults-
|
|
12
|
+
import './defaults-DOGbAFEj.mjs';
|
|
13
13
|
import './defu-n46TJT6t.mjs';
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
17
|
+
import './index-DC60ES8u.mjs';
|
|
18
18
|
import '@csstools/postcss-is-pseudo-class';
|
|
19
19
|
import 'postcss-rem-to-responsive-pixel';
|
|
20
20
|
import 'postcss-selector-parser';
|
|
@@ -13,17 +13,20 @@ var postcssRem2rpx__default = /*#__PURE__*/_interopDefaultCompat(postcssRem2rpx)
|
|
|
13
13
|
var selectorParser__default = /*#__PURE__*/_interopDefaultCompat(selectorParser);
|
|
14
14
|
|
|
15
15
|
const createRuleTransform = (rule, options) => {
|
|
16
|
-
const { escapeMap, mangleContext, cssSelectorReplacement } = options;
|
|
16
|
+
const { escapeMap, mangleContext, cssSelectorReplacement, cssRemoveHoverPseudoClass } = options;
|
|
17
17
|
const transform = (selectors) => {
|
|
18
18
|
selectors.walk((selector) => {
|
|
19
19
|
if (selector.type === 'universal' && cssSelectorReplacement && cssSelectorReplacement.universal) {
|
|
20
20
|
selector.value = shared.composeIsPseudo(cssSelectorReplacement.universal);
|
|
21
21
|
}
|
|
22
|
-
if (selector.type === 'selector') {
|
|
22
|
+
if (cssRemoveHoverPseudoClass && selector.type === 'selector') {
|
|
23
23
|
const node = selector.nodes.find((x) => x.type === 'pseudo' && x.value === ':hover');
|
|
24
24
|
node && selector.remove();
|
|
25
25
|
}
|
|
26
|
-
if (selector.type === 'pseudo' &&
|
|
26
|
+
if (selector.type === 'pseudo' &&
|
|
27
|
+
selector.value === ':root' &&
|
|
28
|
+
cssSelectorReplacement &&
|
|
29
|
+
cssSelectorReplacement.root) {
|
|
27
30
|
selector.value = shared.composeIsPseudo(cssSelectorReplacement.root);
|
|
28
31
|
}
|
|
29
32
|
if (selector.type === 'class') {
|
|
@@ -292,7 +295,10 @@ const initialNodes = cssVars.map((x) => {
|
|
|
292
295
|
value: x.value
|
|
293
296
|
});
|
|
294
297
|
});
|
|
295
|
-
const PATTERNS = [
|
|
298
|
+
const PATTERNS = [
|
|
299
|
+
/:not\(template\)\s*[~+]\s*:not\(template\)/.source,
|
|
300
|
+
/:not\(\[hidden\]\)\s*[~+]\s*:not\(\[hidden\]\)/.source
|
|
301
|
+
].join('|');
|
|
296
302
|
const BROAD_MATCH_GLOBAL_REGEXP = new RegExp(PATTERNS, 'g');
|
|
297
303
|
function testIfVariablesScope(node, count = 2) {
|
|
298
304
|
if (isOnlyBeforeAndAfterPseudoElement(node)) {
|
|
@@ -351,7 +357,9 @@ function remakeCssVarSelector(selectors, options) {
|
|
|
351
357
|
selectors.unshift('*');
|
|
352
358
|
}
|
|
353
359
|
}
|
|
354
|
-
else if (typeof cssSelectorReplacement.universal === 'string' &&
|
|
360
|
+
else if (typeof cssSelectorReplacement.universal === 'string' &&
|
|
361
|
+
!selectors.includes(cssSelectorReplacement.universal) &&
|
|
362
|
+
!selectors.includes('*')) {
|
|
355
363
|
selectors.unshift('*');
|
|
356
364
|
}
|
|
357
365
|
}
|
|
@@ -399,7 +407,8 @@ const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
|
|
|
399
407
|
const WEAPP_TW_REQUIRED_NODE_VERSION = '16.6.0';
|
|
400
408
|
|
|
401
409
|
function isAtMediaHover(atRule) {
|
|
402
|
-
return /media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name) ||
|
|
410
|
+
return (/media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name) ||
|
|
411
|
+
(atRule.name === 'media' && /\(\s*hover\s*:\s*hover\s*\)/.test(atRule.params)));
|
|
403
412
|
}
|
|
404
413
|
const postcssWeappTailwindcssPrePlugin = (options = {
|
|
405
414
|
isMainChunk: true
|
|
@@ -5,17 +5,20 @@ import { c as composeIsPseudo, i as internalCssSelectorReplacer } from './shared
|
|
|
5
5
|
import { Declaration, Rule } from 'postcss';
|
|
6
6
|
|
|
7
7
|
const createRuleTransform = (rule, options) => {
|
|
8
|
-
const { escapeMap, mangleContext, cssSelectorReplacement } = options;
|
|
8
|
+
const { escapeMap, mangleContext, cssSelectorReplacement, cssRemoveHoverPseudoClass } = options;
|
|
9
9
|
const transform = (selectors) => {
|
|
10
10
|
selectors.walk((selector) => {
|
|
11
11
|
if (selector.type === 'universal' && cssSelectorReplacement && cssSelectorReplacement.universal) {
|
|
12
12
|
selector.value = composeIsPseudo(cssSelectorReplacement.universal);
|
|
13
13
|
}
|
|
14
|
-
if (selector.type === 'selector') {
|
|
14
|
+
if (cssRemoveHoverPseudoClass && selector.type === 'selector') {
|
|
15
15
|
const node = selector.nodes.find((x) => x.type === 'pseudo' && x.value === ':hover');
|
|
16
16
|
node && selector.remove();
|
|
17
17
|
}
|
|
18
|
-
if (selector.type === 'pseudo' &&
|
|
18
|
+
if (selector.type === 'pseudo' &&
|
|
19
|
+
selector.value === ':root' &&
|
|
20
|
+
cssSelectorReplacement &&
|
|
21
|
+
cssSelectorReplacement.root) {
|
|
19
22
|
selector.value = composeIsPseudo(cssSelectorReplacement.root);
|
|
20
23
|
}
|
|
21
24
|
if (selector.type === 'class') {
|
|
@@ -284,7 +287,10 @@ const initialNodes = cssVars.map((x) => {
|
|
|
284
287
|
value: x.value
|
|
285
288
|
});
|
|
286
289
|
});
|
|
287
|
-
const PATTERNS = [
|
|
290
|
+
const PATTERNS = [
|
|
291
|
+
/:not\(template\)\s*[~+]\s*:not\(template\)/.source,
|
|
292
|
+
/:not\(\[hidden\]\)\s*[~+]\s*:not\(\[hidden\]\)/.source
|
|
293
|
+
].join('|');
|
|
288
294
|
const BROAD_MATCH_GLOBAL_REGEXP = new RegExp(PATTERNS, 'g');
|
|
289
295
|
function testIfVariablesScope(node, count = 2) {
|
|
290
296
|
if (isOnlyBeforeAndAfterPseudoElement(node)) {
|
|
@@ -343,7 +349,9 @@ function remakeCssVarSelector(selectors, options) {
|
|
|
343
349
|
selectors.unshift('*');
|
|
344
350
|
}
|
|
345
351
|
}
|
|
346
|
-
else if (typeof cssSelectorReplacement.universal === 'string' &&
|
|
352
|
+
else if (typeof cssSelectorReplacement.universal === 'string' &&
|
|
353
|
+
!selectors.includes(cssSelectorReplacement.universal) &&
|
|
354
|
+
!selectors.includes('*')) {
|
|
347
355
|
selectors.unshift('*');
|
|
348
356
|
}
|
|
349
357
|
}
|
|
@@ -391,7 +399,8 @@ const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
|
|
|
391
399
|
const WEAPP_TW_REQUIRED_NODE_VERSION = '16.6.0';
|
|
392
400
|
|
|
393
401
|
function isAtMediaHover(atRule) {
|
|
394
|
-
return /media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name) ||
|
|
402
|
+
return (/media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name) ||
|
|
403
|
+
(atRule.name === 'media' && /\(\s*hover\s*:\s*hover\s*\)/.test(atRule.params)));
|
|
395
404
|
}
|
|
396
405
|
const postcssWeappTailwindcssPrePlugin = (options = {
|
|
397
406
|
isMainChunk: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D1IYbX_E.mjs';
|
|
2
2
|
import stream from 'node:stream';
|
|
3
3
|
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
4
4
|
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
2
|
-
import { v as vitePluginName } from './index-
|
|
3
|
-
import { g as getGroupedEntries } from './defaults-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D1IYbX_E.mjs';
|
|
2
|
+
import { v as vitePluginName } from './index-DC60ES8u.mjs';
|
|
3
|
+
import { g as getGroupedEntries } from './defaults-DOGbAFEj.mjs';
|
|
4
4
|
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
5
5
|
|
|
6
6
|
const debug = createDebug();
|
|
7
7
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
8
|
-
if (options.customReplaceDictionary === undefined) {
|
|
9
|
-
options.customReplaceDictionary = 'simple';
|
|
10
|
-
}
|
|
11
8
|
const opts = getOptions(options);
|
|
12
9
|
const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet, cache, tailwindcssBasedir } = opts;
|
|
13
10
|
if (disabled) {
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
4
|
-
var index = require('./index-
|
|
5
|
-
var defaults = require('./defaults-
|
|
3
|
+
var options = require('./options-BjZGMFOk.js');
|
|
4
|
+
var index = require('./index-6BUjj8Rl.js');
|
|
5
|
+
var defaults = require('./defaults-CGBcgdIr.js');
|
|
6
6
|
var index$1 = require('./index-HC-Qkn0i.js');
|
|
7
7
|
|
|
8
8
|
const debug = index$1.createDebug();
|
|
9
9
|
function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
|
|
10
|
-
if (options$1.customReplaceDictionary === undefined) {
|
|
11
|
-
options$1.customReplaceDictionary = 'simple';
|
|
12
|
-
}
|
|
13
10
|
const opts = options.getOptions(options$1);
|
|
14
11
|
const { disabled, onEnd, onLoad, onStart, onUpdate, templateHandler, styleHandler, patch, jsHandler, mainCssChunkMatcher, appType, setMangleRuntimeSet, cache, tailwindcssBasedir } = opts;
|
|
15
12
|
if (disabled) {
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var v5 = require('./v5-
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var index$1 = require('./index-
|
|
8
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-DA4DSMKO.js');
|
|
6
|
+
var index = require('./index-iiM-deHl.js');
|
|
7
|
+
var index$1 = require('./index-BpY7tq3j.js');
|
|
8
|
+
require('./options-BjZGMFOk.js');
|
|
9
9
|
require('magic-string');
|
|
10
10
|
require('./replace.js');
|
|
11
11
|
require('@weapp-core/escape');
|
|
@@ -15,12 +15,12 @@ require('@weapp-core/regex');
|
|
|
15
15
|
require('@babel/generator');
|
|
16
16
|
require('@babel/traverse');
|
|
17
17
|
require('@babel/parser');
|
|
18
|
-
require('./defaults-
|
|
18
|
+
require('./defaults-CGBcgdIr.js');
|
|
19
19
|
require('./defu-Cdz2PomB.js');
|
|
20
20
|
require('@babel/types');
|
|
21
21
|
require('htmlparser2');
|
|
22
22
|
require('postcss');
|
|
23
|
-
require('./index-
|
|
23
|
+
require('./index-6BUjj8Rl.js');
|
|
24
24
|
require('@csstools/postcss-is-pseudo-class');
|
|
25
25
|
require('postcss-rem-to-responsive-pixel');
|
|
26
26
|
require('postcss-selector-parser');
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { U as UnifiedWebpackPluginV5 } from './v5-
|
|
2
|
-
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-
|
|
3
|
-
export { c as createPlugins } from './index-
|
|
4
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-C6FTqEeL.mjs';
|
|
2
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-UGtfFwsf.mjs';
|
|
3
|
+
export { c as createPlugins } from './index-EnQF5WiI.mjs';
|
|
4
|
+
import './options-D1IYbX_E.mjs';
|
|
5
5
|
import 'magic-string';
|
|
6
6
|
import './replace.mjs';
|
|
7
7
|
import '@weapp-core/escape';
|
|
@@ -11,12 +11,12 @@ import '@weapp-core/regex';
|
|
|
11
11
|
import '@babel/generator';
|
|
12
12
|
import '@babel/traverse';
|
|
13
13
|
import '@babel/parser';
|
|
14
|
-
import './defaults-
|
|
14
|
+
import './defaults-DOGbAFEj.mjs';
|
|
15
15
|
import './defu-n46TJT6t.mjs';
|
|
16
16
|
import '@babel/types';
|
|
17
17
|
import 'htmlparser2';
|
|
18
18
|
import 'postcss';
|
|
19
|
-
import './index-
|
|
19
|
+
import './index-DC60ES8u.mjs';
|
|
20
20
|
import '@csstools/postcss-is-pseudo-class';
|
|
21
21
|
import 'postcss-rem-to-responsive-pixel';
|
|
22
22
|
import 'postcss-selector-parser';
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
var MagicString = require('magic-string');
|
|
4
4
|
var replace = require('./replace.js');
|
|
5
5
|
var regex = require('@weapp-core/regex');
|
|
6
|
-
|
|
6
|
+
require('@weapp-core/escape');
|
|
7
7
|
var escape = require('@ast-core/escape');
|
|
8
8
|
var _babelGenerate = require('@babel/generator');
|
|
9
9
|
var _babelTraverse = require('@babel/traverse');
|
|
10
10
|
var parser = require('@babel/parser');
|
|
11
|
-
var defaults = require('./defaults-
|
|
11
|
+
var defaults = require('./defaults-CGBcgdIr.js');
|
|
12
12
|
var t = require('@babel/types');
|
|
13
13
|
var htmlparser2 = require('htmlparser2');
|
|
14
14
|
var postcss = require('postcss');
|
|
15
|
-
var index = require('./index-
|
|
15
|
+
var index = require('./index-6BUjj8Rl.js');
|
|
16
16
|
var path = require('node:path');
|
|
17
17
|
var fs = require('node:fs');
|
|
18
18
|
var semver = require('semver');
|
|
@@ -111,7 +111,8 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
|
111
111
|
if (always || (set && set.has(v) && !(jsPreserveClass === null || jsPreserveClass === void 0 ? void 0 : jsPreserveClass(v)))) {
|
|
112
112
|
let ignoreFlag = false;
|
|
113
113
|
if (Array.isArray(node.leadingComments)) {
|
|
114
|
-
ignoreFlag =
|
|
114
|
+
ignoreFlag =
|
|
115
|
+
node.leadingComments.findIndex((x) => x.value.includes('weapp-tw') && x.value.includes('ignore')) > -1;
|
|
115
116
|
}
|
|
116
117
|
if (!ignoreFlag) {
|
|
117
118
|
if (ctx) {
|
|
@@ -430,7 +431,8 @@ function customTemplateHandler(rawSource, options) {
|
|
|
430
431
|
function update() {
|
|
431
432
|
s.update(parser.startIndex + name.length + 2, parser.endIndex - 1, templateReplacer(value, Object.assign(Object.assign({}, options), { quote })));
|
|
432
433
|
}
|
|
433
|
-
if (!disabledDefaultTemplateHandler &&
|
|
434
|
+
if (!disabledDefaultTemplateHandler &&
|
|
435
|
+
(name === 'class' || name === 'hover-class' || name === 'virtualHostClass' || name === 'virtualhostclass')) {
|
|
434
436
|
update();
|
|
435
437
|
}
|
|
436
438
|
for (const [t, props] of customAttributesEntities) {
|
|
@@ -521,7 +523,9 @@ function findAstNode(content, options) {
|
|
|
521
523
|
let changed = false;
|
|
522
524
|
traverse(ast, {
|
|
523
525
|
Identifier(path) {
|
|
524
|
-
if (path.node.name === DOPTS.variableName &&
|
|
526
|
+
if (path.node.name === DOPTS.variableName &&
|
|
527
|
+
t__namespace.isVariableDeclarator(path.parent) &&
|
|
528
|
+
t__namespace.isArrayExpression(path.parent.init)) {
|
|
525
529
|
arrayRef = path.parent.init;
|
|
526
530
|
const set = new Set(path.parent.init.elements.map((x) => x.value));
|
|
527
531
|
for (let i = 0; i < options.units.length; i++) {
|
|
@@ -771,20 +775,16 @@ function createCache(options) {
|
|
|
771
775
|
};
|
|
772
776
|
}
|
|
773
777
|
|
|
774
|
-
function getOptions(
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
}
|
|
778
|
-
const result = defaults.defuOverrideArray(options, defaults.defaultOptions, {});
|
|
779
|
-
const { cssPreflight, customRuleCallback, cssPreflightRange, customAttributes, customReplaceDictionary, supportCustomLengthUnitsPatch, arbitraryValues, cssChildCombinatorReplaceValue, inlineWxs, injectAdditionalCssVarScope, jsPreserveClass, disabledDefaultTemplateHandler, cssSelectorReplacement, rem2rpx, cache, jsAstTool, babelParserOptions, postcssOptions } = result;
|
|
780
|
-
result.escapeMap = customReplaceDictionary;
|
|
778
|
+
function getOptions(opts) {
|
|
779
|
+
const result = defaults.defuOverrideArray(opts, defaults.defaultOptions, {});
|
|
780
|
+
result.escapeMap = result.customReplaceDictionary;
|
|
781
|
+
const { cssPreflight, customRuleCallback, cssPreflightRange, customAttributes, supportCustomLengthUnitsPatch, arbitraryValues, cssChildCombinatorReplaceValue, inlineWxs, injectAdditionalCssVarScope, jsPreserveClass, disabledDefaultTemplateHandler, cssSelectorReplacement, rem2rpx, cache, jsAstTool, babelParserOptions, postcssOptions, cssRemoveHoverPseudoClass, escapeMap, mangle } = result;
|
|
781
782
|
const cssInjectPreflight = createInjectPreflight(cssPreflight);
|
|
782
|
-
const customAttributesEntities = defaults.isMap(
|
|
783
|
-
? [...
|
|
783
|
+
const customAttributesEntities = defaults.isMap(customAttributes)
|
|
784
|
+
? [...customAttributes.entries()]
|
|
784
785
|
: Object.entries(customAttributes);
|
|
785
|
-
const { escapeMap } = result;
|
|
786
786
|
const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
|
|
787
|
-
initMangle(
|
|
787
|
+
initMangle(mangle);
|
|
788
788
|
const styleHandler = createStyleHandler({
|
|
789
789
|
cssInjectPreflight,
|
|
790
790
|
customRuleCallback,
|
|
@@ -795,9 +795,9 @@ function getOptions(options = {}) {
|
|
|
795
795
|
injectAdditionalCssVarScope,
|
|
796
796
|
cssSelectorReplacement,
|
|
797
797
|
rem2rpx,
|
|
798
|
-
postcssOptions
|
|
798
|
+
postcssOptions,
|
|
799
|
+
cssRemoveHoverPseudoClass
|
|
799
800
|
});
|
|
800
|
-
result.styleHandler = styleHandler;
|
|
801
801
|
const jsHandler = createJsHandler({
|
|
802
802
|
escapeMap,
|
|
803
803
|
mangleContext,
|
|
@@ -807,7 +807,6 @@ function getOptions(options = {}) {
|
|
|
807
807
|
jsAstTool,
|
|
808
808
|
babelParserOptions
|
|
809
809
|
});
|
|
810
|
-
result.jsHandler = jsHandler;
|
|
811
810
|
const templateHandler = createTemplateHandler({
|
|
812
811
|
customAttributesEntities,
|
|
813
812
|
escapeMap,
|
|
@@ -816,6 +815,8 @@ function getOptions(options = {}) {
|
|
|
816
815
|
jsHandler,
|
|
817
816
|
disabledDefaultTemplateHandler
|
|
818
817
|
});
|
|
818
|
+
result.styleHandler = styleHandler;
|
|
819
|
+
result.jsHandler = jsHandler;
|
|
819
820
|
result.templateHandler = templateHandler;
|
|
820
821
|
result.patch = createPatch(supportCustomLengthUnitsPatch);
|
|
821
822
|
result.setMangleRuntimeSet = setMangleRuntimeSet;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import MagicString from 'magic-string';
|
|
2
2
|
import { replaceJs as replaceWxml } from './replace.mjs';
|
|
3
3
|
import { escapeStringRegexp, variableRegExp } from '@weapp-core/regex';
|
|
4
|
-
import
|
|
4
|
+
import '@weapp-core/escape';
|
|
5
5
|
import { jsStringEscape } from '@ast-core/escape';
|
|
6
6
|
import _babelGenerate from '@babel/generator';
|
|
7
7
|
import _babelTraverse from '@babel/traverse';
|
|
8
8
|
import { parse, parseExpression } from '@babel/parser';
|
|
9
|
-
import { d as defuOverrideArray, n as noop, a as defaultOptions, i as isMap } from './defaults-
|
|
9
|
+
import { d as defuOverrideArray, n as noop, a as defaultOptions, i as isMap } from './defaults-DOGbAFEj.mjs';
|
|
10
10
|
import * as t from '@babel/types';
|
|
11
11
|
import { Parser } from 'htmlparser2';
|
|
12
12
|
import postcss from 'postcss';
|
|
13
|
-
import { g as getPlugins } from './index-
|
|
13
|
+
import { g as getPlugins } from './index-DC60ES8u.mjs';
|
|
14
14
|
import path from 'node:path';
|
|
15
15
|
import fs from 'node:fs';
|
|
16
16
|
import { gte } from 'semver';
|
|
@@ -80,7 +80,8 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
|
80
80
|
if (always || (set && set.has(v) && !(jsPreserveClass === null || jsPreserveClass === void 0 ? void 0 : jsPreserveClass(v)))) {
|
|
81
81
|
let ignoreFlag = false;
|
|
82
82
|
if (Array.isArray(node.leadingComments)) {
|
|
83
|
-
ignoreFlag =
|
|
83
|
+
ignoreFlag =
|
|
84
|
+
node.leadingComments.findIndex((x) => x.value.includes('weapp-tw') && x.value.includes('ignore')) > -1;
|
|
84
85
|
}
|
|
85
86
|
if (!ignoreFlag) {
|
|
86
87
|
if (ctx) {
|
|
@@ -399,7 +400,8 @@ function customTemplateHandler(rawSource, options) {
|
|
|
399
400
|
function update() {
|
|
400
401
|
s.update(parser.startIndex + name.length + 2, parser.endIndex - 1, templateReplacer(value, Object.assign(Object.assign({}, options), { quote })));
|
|
401
402
|
}
|
|
402
|
-
if (!disabledDefaultTemplateHandler &&
|
|
403
|
+
if (!disabledDefaultTemplateHandler &&
|
|
404
|
+
(name === 'class' || name === 'hover-class' || name === 'virtualHostClass' || name === 'virtualhostclass')) {
|
|
403
405
|
update();
|
|
404
406
|
}
|
|
405
407
|
for (const [t, props] of customAttributesEntities) {
|
|
@@ -490,7 +492,9 @@ function findAstNode(content, options) {
|
|
|
490
492
|
let changed = false;
|
|
491
493
|
traverse(ast, {
|
|
492
494
|
Identifier(path) {
|
|
493
|
-
if (path.node.name === DOPTS.variableName &&
|
|
495
|
+
if (path.node.name === DOPTS.variableName &&
|
|
496
|
+
t.isVariableDeclarator(path.parent) &&
|
|
497
|
+
t.isArrayExpression(path.parent.init)) {
|
|
494
498
|
arrayRef = path.parent.init;
|
|
495
499
|
const set = new Set(path.parent.init.elements.map((x) => x.value));
|
|
496
500
|
for (let i = 0; i < options.units.length; i++) {
|
|
@@ -740,20 +744,16 @@ function createCache(options) {
|
|
|
740
744
|
};
|
|
741
745
|
}
|
|
742
746
|
|
|
743
|
-
function getOptions(
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
}
|
|
747
|
-
const result = defuOverrideArray(options, defaultOptions, {});
|
|
748
|
-
const { cssPreflight, customRuleCallback, cssPreflightRange, customAttributes, customReplaceDictionary, supportCustomLengthUnitsPatch, arbitraryValues, cssChildCombinatorReplaceValue, inlineWxs, injectAdditionalCssVarScope, jsPreserveClass, disabledDefaultTemplateHandler, cssSelectorReplacement, rem2rpx, cache, jsAstTool, babelParserOptions, postcssOptions } = result;
|
|
749
|
-
result.escapeMap = customReplaceDictionary;
|
|
747
|
+
function getOptions(opts) {
|
|
748
|
+
const result = defuOverrideArray(opts, defaultOptions, {});
|
|
749
|
+
result.escapeMap = result.customReplaceDictionary;
|
|
750
|
+
const { cssPreflight, customRuleCallback, cssPreflightRange, customAttributes, supportCustomLengthUnitsPatch, arbitraryValues, cssChildCombinatorReplaceValue, inlineWxs, injectAdditionalCssVarScope, jsPreserveClass, disabledDefaultTemplateHandler, cssSelectorReplacement, rem2rpx, cache, jsAstTool, babelParserOptions, postcssOptions, cssRemoveHoverPseudoClass, escapeMap, mangle } = result;
|
|
750
751
|
const cssInjectPreflight = createInjectPreflight(cssPreflight);
|
|
751
|
-
const customAttributesEntities = isMap(
|
|
752
|
-
? [...
|
|
752
|
+
const customAttributesEntities = isMap(customAttributes)
|
|
753
|
+
? [...customAttributes.entries()]
|
|
753
754
|
: Object.entries(customAttributes);
|
|
754
|
-
const { escapeMap } = result;
|
|
755
755
|
const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
|
|
756
|
-
initMangle(
|
|
756
|
+
initMangle(mangle);
|
|
757
757
|
const styleHandler = createStyleHandler({
|
|
758
758
|
cssInjectPreflight,
|
|
759
759
|
customRuleCallback,
|
|
@@ -764,9 +764,9 @@ function getOptions(options = {}) {
|
|
|
764
764
|
injectAdditionalCssVarScope,
|
|
765
765
|
cssSelectorReplacement,
|
|
766
766
|
rem2rpx,
|
|
767
|
-
postcssOptions
|
|
767
|
+
postcssOptions,
|
|
768
|
+
cssRemoveHoverPseudoClass
|
|
768
769
|
});
|
|
769
|
-
result.styleHandler = styleHandler;
|
|
770
770
|
const jsHandler = createJsHandler({
|
|
771
771
|
escapeMap,
|
|
772
772
|
mangleContext,
|
|
@@ -776,7 +776,6 @@ function getOptions(options = {}) {
|
|
|
776
776
|
jsAstTool,
|
|
777
777
|
babelParserOptions
|
|
778
778
|
});
|
|
779
|
-
result.jsHandler = jsHandler;
|
|
780
779
|
const templateHandler = createTemplateHandler({
|
|
781
780
|
customAttributesEntities,
|
|
782
781
|
escapeMap,
|
|
@@ -785,6 +784,8 @@ function getOptions(options = {}) {
|
|
|
785
784
|
jsHandler,
|
|
786
785
|
disabledDefaultTemplateHandler
|
|
787
786
|
});
|
|
787
|
+
result.styleHandler = styleHandler;
|
|
788
|
+
result.jsHandler = jsHandler;
|
|
788
789
|
result.templateHandler = templateHandler;
|
|
789
790
|
result.patch = createPatch(supportCustomLengthUnitsPatch);
|
|
790
791
|
result.setMangleRuntimeSet = setMangleRuntimeSet;
|
package/dist/options.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { InternalUserDefinedOptions, UserDefinedOptions } from './types';
|
|
2
|
-
export declare function getOptions(
|
|
2
|
+
export declare function getOptions(opts?: UserDefinedOptions): InternalUserDefinedOptions;
|
package/dist/postcss.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-6BUjj8Rl.js');
|
|
6
6
|
var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
|
|
7
7
|
var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
|
|
8
8
|
require('postcss-selector-parser');
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getPlugins, p as postcssWeappTailwindcssPostPlugin, a as postcssWeappTailwindcssPrePlugin } from './index-
|
|
1
|
+
export { g as getPlugins, p as postcssWeappTailwindcssPostPlugin, a as postcssWeappTailwindcssPrePlugin } from './index-DC60ES8u.mjs';
|
|
2
2
|
export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
|
|
3
3
|
export { default as postcssRem2rpx } from 'postcss-rem-to-responsive-pixel';
|
|
4
4
|
import 'postcss-selector-parser';
|
package/dist/types.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export type IStyleHandlerOptions = {
|
|
|
34
34
|
mangleContext?: IMangleScopeContext;
|
|
35
35
|
ctx?: PostcssContext;
|
|
36
36
|
postcssOptions?: PostcssOptions;
|
|
37
|
+
cssRemoveHoverPseudoClass?: boolean;
|
|
37
38
|
} & RequiredStyleHandlerOptions;
|
|
38
39
|
export type JsHandlerReplaceResult = {
|
|
39
40
|
code: string;
|
|
@@ -98,7 +99,7 @@ export interface UserDefinedOptions {
|
|
|
98
99
|
onUpdate?: (filename: string, oldVal: string, newVal: string) => void;
|
|
99
100
|
onEnd?: () => void;
|
|
100
101
|
customAttributes?: ICustomAttributes;
|
|
101
|
-
customReplaceDictionary?:
|
|
102
|
+
customReplaceDictionary?: Record<string, string>;
|
|
102
103
|
supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions;
|
|
103
104
|
appType?: AppType;
|
|
104
105
|
mangle?: boolean | IMangleOptions;
|
|
@@ -120,6 +121,7 @@ export interface UserDefinedOptions {
|
|
|
120
121
|
jsAstTool?: 'babel' | 'ast-grep';
|
|
121
122
|
babelParserOptions?: ParserOptions;
|
|
122
123
|
postcssOptions?: PostcssOptions;
|
|
124
|
+
cssRemoveHoverPseudoClass?: boolean;
|
|
123
125
|
}
|
|
124
126
|
export type JsHandler = (rawSource: string, set: Set<string>, options?: CreateJsHandlerOptions) => JsHandlerResult | Promise<JsHandlerResult>;
|
|
125
127
|
export interface IMangleScopeContext {
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D1IYbX_E.mjs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
-
import { b as pluginName } from './index-
|
|
5
|
-
import { g as getGroupedEntries, r as removeExt } from './defaults-
|
|
4
|
+
import { b as pluginName } from './index-DC60ES8u.mjs';
|
|
5
|
+
import { g as getGroupedEntries, r as removeExt } from './defaults-DOGbAFEj.mjs';
|
|
6
6
|
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
7
7
|
|
|
8
8
|
const debug = createDebug();
|
|
9
9
|
class UnifiedWebpackPluginV5 {
|
|
10
10
|
constructor(options = {}) {
|
|
11
|
-
if (options.customReplaceDictionary === undefined) {
|
|
12
|
-
options.customReplaceDictionary = 'simple';
|
|
13
|
-
}
|
|
14
11
|
this.options = getOptions(options);
|
|
15
12
|
this.appType = this.options.appType;
|
|
16
13
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-BjZGMFOk.js');
|
|
4
4
|
var path = require('node:path');
|
|
5
5
|
var fs = require('node:fs');
|
|
6
|
-
var index = require('./index-
|
|
7
|
-
var defaults = require('./defaults-
|
|
6
|
+
var index = require('./index-6BUjj8Rl.js');
|
|
7
|
+
var defaults = require('./defaults-CGBcgdIr.js');
|
|
8
8
|
var index$1 = require('./index-HC-Qkn0i.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
@@ -15,9 +15,6 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
|
15
15
|
const debug = index$1.createDebug();
|
|
16
16
|
class UnifiedWebpackPluginV5 {
|
|
17
17
|
constructor(options$1 = {}) {
|
|
18
|
-
if (options$1.customReplaceDictionary === undefined) {
|
|
19
|
-
options$1.customReplaceDictionary = 'simple';
|
|
20
|
-
}
|
|
21
18
|
this.options = options.getOptions(options$1);
|
|
22
19
|
this.appType = this.options.appType;
|
|
23
20
|
}
|
package/dist/vite.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('./options-
|
|
5
|
+
var index = require('./index-iiM-deHl.js');
|
|
6
|
+
require('./options-BjZGMFOk.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -13,12 +13,12 @@ require('@weapp-core/regex');
|
|
|
13
13
|
require('@babel/generator');
|
|
14
14
|
require('@babel/traverse');
|
|
15
15
|
require('@babel/parser');
|
|
16
|
-
require('./defaults-
|
|
16
|
+
require('./defaults-CGBcgdIr.js');
|
|
17
17
|
require('./defu-Cdz2PomB.js');
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-6BUjj8Rl.js');
|
|
22
22
|
require('@csstools/postcss-is-pseudo-class');
|
|
23
23
|
require('postcss-rem-to-responsive-pixel');
|
|
24
24
|
require('postcss-selector-parser');
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-
|
|
2
|
-
import './options-
|
|
1
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-UGtfFwsf.mjs';
|
|
2
|
+
import './options-D1IYbX_E.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -9,12 +9,12 @@ import '@weapp-core/regex';
|
|
|
9
9
|
import '@babel/generator';
|
|
10
10
|
import '@babel/traverse';
|
|
11
11
|
import '@babel/parser';
|
|
12
|
-
import './defaults-
|
|
12
|
+
import './defaults-DOGbAFEj.mjs';
|
|
13
13
|
import './defu-n46TJT6t.mjs';
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
17
|
+
import './index-DC60ES8u.mjs';
|
|
18
18
|
import '@csstools/postcss-is-pseudo-class';
|
|
19
19
|
import 'postcss-rem-to-responsive-pixel';
|
|
20
20
|
import 'postcss-selector-parser';
|
package/dist/webpack.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var v5 = require('./v5-
|
|
6
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-DA4DSMKO.js');
|
|
6
|
+
require('./options-BjZGMFOk.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -13,12 +13,12 @@ require('@weapp-core/regex');
|
|
|
13
13
|
require('@babel/generator');
|
|
14
14
|
require('@babel/traverse');
|
|
15
15
|
require('@babel/parser');
|
|
16
|
-
require('./defaults-
|
|
16
|
+
require('./defaults-CGBcgdIr.js');
|
|
17
17
|
require('./defu-Cdz2PomB.js');
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-6BUjj8Rl.js');
|
|
22
22
|
require('@csstools/postcss-is-pseudo-class');
|
|
23
23
|
require('postcss-rem-to-responsive-pixel');
|
|
24
24
|
require('postcss-selector-parser');
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UnifiedWebpackPluginV5 } from './v5-
|
|
2
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-C6FTqEeL.mjs';
|
|
2
|
+
import './options-D1IYbX_E.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -9,12 +9,12 @@ import '@weapp-core/regex';
|
|
|
9
9
|
import '@babel/generator';
|
|
10
10
|
import '@babel/traverse';
|
|
11
11
|
import '@babel/parser';
|
|
12
|
-
import './defaults-
|
|
12
|
+
import './defaults-DOGbAFEj.mjs';
|
|
13
13
|
import './defu-n46TJT6t.mjs';
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
17
|
+
import './index-DC60ES8u.mjs';
|
|
18
18
|
import '@csstools/postcss-is-pseudo-class';
|
|
19
19
|
import 'postcss-rem-to-responsive-pixel';
|
|
20
20
|
import 'postcss-selector-parser';
|
package/dist/webpack4.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var options = require('./options-
|
|
5
|
+
var options = require('./options-BjZGMFOk.js');
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var fs = require('node:fs');
|
|
8
8
|
var webpackSources = require('webpack-sources');
|
|
9
|
-
var index = require('./index-
|
|
10
|
-
var defaults = require('./defaults-
|
|
9
|
+
var index = require('./index-6BUjj8Rl.js');
|
|
10
|
+
var defaults = require('./defaults-CGBcgdIr.js');
|
|
11
11
|
var index$1 = require('./index-HC-Qkn0i.js');
|
|
12
12
|
require('magic-string');
|
|
13
13
|
require('./replace.js');
|
|
@@ -40,9 +40,6 @@ var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
|
40
40
|
const debug = index$1.createDebug();
|
|
41
41
|
class UnifiedWebpackPluginV4 {
|
|
42
42
|
constructor(options$1 = {}) {
|
|
43
|
-
if (options$1.customReplaceDictionary === undefined) {
|
|
44
|
-
options$1.customReplaceDictionary = 'simple';
|
|
45
|
-
}
|
|
46
43
|
this.options = options.getOptions(options$1);
|
|
47
44
|
this.appType = this.options.appType;
|
|
48
45
|
}
|
package/dist/webpack4.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D1IYbX_E.mjs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import { ConcatSource, RawSource } from 'webpack-sources';
|
|
5
|
-
import { b as pluginName } from './index-
|
|
6
|
-
import { g as getGroupedEntries, r as removeExt } from './defaults-
|
|
5
|
+
import { b as pluginName } from './index-DC60ES8u.mjs';
|
|
6
|
+
import { g as getGroupedEntries, r as removeExt } from './defaults-DOGbAFEj.mjs';
|
|
7
7
|
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
8
8
|
import 'magic-string';
|
|
9
9
|
import './replace.mjs';
|
|
@@ -31,9 +31,6 @@ import 'debug';
|
|
|
31
31
|
const debug = createDebug();
|
|
32
32
|
class UnifiedWebpackPluginV4 {
|
|
33
33
|
constructor(options = {}) {
|
|
34
|
-
if (options.customReplaceDictionary === undefined) {
|
|
35
|
-
options.customReplaceDictionary = 'simple';
|
|
36
|
-
}
|
|
37
34
|
this.options = getOptions(options);
|
|
38
35
|
this.appType = this.options.appType;
|
|
39
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "把tailwindcss jit引擎,带给小程序开发者们! bring tailwindcss jit engine to miniprogram developers!",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -118,15 +118,15 @@
|
|
|
118
118
|
"author": "SonOfMagic <qq1324318532@gmail.com>",
|
|
119
119
|
"license": "MIT",
|
|
120
120
|
"bugs": {
|
|
121
|
-
"url": "https://github.com/sonofmagic/weapp-tailwindcss
|
|
121
|
+
"url": "https://github.com/sonofmagic/weapp-tailwindcss/issues"
|
|
122
122
|
},
|
|
123
123
|
"homepage": "https://weapp-tw.icebreaker.top",
|
|
124
124
|
"dependencies": {
|
|
125
125
|
"@ast-core/escape": "^1.0.1",
|
|
126
|
-
"@babel/generator": "7.24.
|
|
127
|
-
"@babel/parser": "7.24.
|
|
128
|
-
"@babel/traverse": "7.24.
|
|
129
|
-
"@babel/types": "7.24.
|
|
126
|
+
"@babel/generator": "7.24.5",
|
|
127
|
+
"@babel/parser": "7.24.5",
|
|
128
|
+
"@babel/traverse": "7.24.5",
|
|
129
|
+
"@babel/types": "7.24.5",
|
|
130
130
|
"@csstools/postcss-is-pseudo-class": "4.0.6",
|
|
131
131
|
"@tailwindcss-mangle/shared": "^2.2.2",
|
|
132
132
|
"@weapp-core/escape": "^2.0.0",
|
|
@@ -134,13 +134,13 @@
|
|
|
134
134
|
"debug": "4.3.4",
|
|
135
135
|
"htmlparser2": "9.1.0",
|
|
136
136
|
"loader-utils": "2.0.4",
|
|
137
|
-
"lru-cache": "10.2.
|
|
137
|
+
"lru-cache": "10.2.2",
|
|
138
138
|
"magic-string": "0.30.10",
|
|
139
139
|
"md5": "2.3.0",
|
|
140
140
|
"postcss": "8.4.38",
|
|
141
141
|
"postcss-rem-to-responsive-pixel": "^6.0.1",
|
|
142
142
|
"postcss-selector-parser": "6.0.16",
|
|
143
|
-
"semver": "7.6.
|
|
143
|
+
"semver": "7.6.1",
|
|
144
144
|
"tailwindcss-patch": "^2.2.3",
|
|
145
145
|
"webpack-sources": "3.2.3"
|
|
146
146
|
},
|
|
@@ -157,17 +157,17 @@
|
|
|
157
157
|
"test:dev": "vitest",
|
|
158
158
|
"test:ui": "vitest --ui",
|
|
159
159
|
"vitest:coverage": "vitest run --coverage",
|
|
160
|
-
"init:rename": "node scripts/init/rename.js",
|
|
161
160
|
"clean": "node scripts/clean.js",
|
|
162
161
|
"raw": "ts-node scripts/raw",
|
|
163
162
|
"get-decl": "ts-node scripts/get-decl.ts",
|
|
164
|
-
"sync": "cnpm sync weapp-tailwindcss-webpack-plugin weapp-tailwindcss",
|
|
165
|
-
"generate:readme": "ts-node scripts/readme/write.ts",
|
|
163
|
+
"sync": "cnpm sync weapp-tailwindcss-webpack-plugin weapp-tailwindcss weapp-tw",
|
|
166
164
|
"format": "prettier --check \"src/**/*.{ts,js}\" -w",
|
|
167
165
|
"format:test": "prettier --check \"test/**/*.test.{ts,js}\" -w",
|
|
168
166
|
"ls:pack": "npm pack --dry-run",
|
|
169
167
|
"cli:patch": "node bin/weapp-tailwindcss.js patch",
|
|
170
|
-
"
|
|
168
|
+
"bump": "bumpp",
|
|
169
|
+
"release": "node scripts/release.js",
|
|
170
|
+
"generate:readme": "ts-node scripts/readme/write.ts",
|
|
171
171
|
"-------": "-----------",
|
|
172
172
|
"postinstall": "node bin/weapp-tailwindcss.js patch"
|
|
173
173
|
}
|