weapp-tailwindcss 3.5.1 → 3.5.3

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 (52) hide show
  1. package/README.md +8 -8
  2. package/dist/bundlers/gulp/index.d.ts +1 -1
  3. package/dist/cache/index.d.ts +1 -1
  4. package/dist/cli.js +3382 -27
  5. package/dist/cli.mjs +3374 -26
  6. package/dist/core.js +12 -12
  7. package/dist/core.mjs +12 -12
  8. package/dist/css-macro/index.js +1 -1
  9. package/dist/css-macro/index.mjs +1 -1
  10. package/dist/{defaults-w3rlKQwe.mjs → defaults-5A8JI2hW.mjs} +3 -3
  11. package/dist/{defaults-DW-EahCC.js → defaults-CdqzSWsR.js} +3 -3
  12. package/dist/defaults.js +2 -2
  13. package/dist/defaults.mjs +2 -2
  14. package/dist/escape.d.ts +1 -1
  15. package/dist/gulp.js +14 -14
  16. package/dist/gulp.mjs +14 -14
  17. package/dist/{index-CCbEWRGc.js → index-B2LUAr--.js} +126 -126
  18. package/dist/{index-CvOeCzMu.mjs → index-BOz3IEuV.mjs} +2 -2
  19. package/dist/{index-BmK79Rz9.mjs → index-BfmTmdHm.mjs} +3 -3
  20. package/dist/{index-OCXtSR4S.js → index-DIZlWN56.js} +3 -3
  21. package/dist/{index-Dm02XDmu.js → index-Dbbfs_Dv.js} +2 -2
  22. package/dist/{index-szMvMylQ.mjs → index-zFq7tKDr.mjs} +126 -126
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +20 -20
  25. package/dist/index.mjs +18 -18
  26. package/dist/init.d.ts +34 -0
  27. package/dist/logger.d.ts +1 -0
  28. package/dist/npm.d.ts +22 -0
  29. package/dist/{options-GppthPlx.mjs → options-BDij5-AP.mjs} +112 -112
  30. package/dist/{options-Uv-owbdp.js → options-DslwksAa.js} +114 -114
  31. package/dist/postcss/index.d.ts +1 -1
  32. package/dist/postcss/mp.d.ts +1 -1
  33. package/dist/postcss/selectorParser.d.ts +1 -1
  34. package/dist/postcss.js +4 -4
  35. package/dist/postcss.mjs +4 -4
  36. package/dist/replace.d.ts +2 -2
  37. package/dist/replace.js +2 -2
  38. package/dist/replace.mjs +2 -2
  39. package/dist/types.d.ts +6 -6
  40. package/dist/{v5-DqFFl6uq.mjs → v5-D7B3M2-H.mjs} +4 -4
  41. package/dist/{v5-C_U1pkH8.js → v5-axtiXCio.js} +5 -5
  42. package/dist/vite.js +13 -13
  43. package/dist/vite.mjs +13 -13
  44. package/dist/webpack.js +13 -13
  45. package/dist/webpack.mjs +13 -13
  46. package/dist/webpack4.js +13 -13
  47. package/dist/webpack4.mjs +12 -12
  48. package/dist/wxml/index.d.ts +1 -1
  49. package/dist/wxml/utils.d.ts +1 -1
  50. package/package.json +11 -8
  51. package/dist/{shared-DbJl6i6a.mjs → shared-COWjpokr.mjs} +1 -1
  52. package/dist/{shared-hzYeE1wX.js → shared-r_GpWheO.js} +1 -1
package/dist/core.js CHANGED
@@ -2,31 +2,31 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-Uv-owbdp.js');
5
+ var options = require('./options-DslwksAa.js');
6
+ require('lru-cache');
7
+ require('md5');
8
+ require('./defaults-CdqzSWsR.js');
9
+ require('@ast-core/escape');
10
+ require('@weapp-core/escape');
11
+ require('./defu-Cdz2PomB.js');
6
12
  require('magic-string');
7
13
  require('@babel/generator');
8
14
  require('@babel/traverse');
9
15
  require('@babel/parser');
10
- require('@weapp-core/escape');
11
- require('@ast-core/escape');
12
- require('./defaults-DW-EahCC.js');
13
- require('./defu-Cdz2PomB.js');
14
- require('./replace.js');
15
- require('./shared-hzYeE1wX.js');
16
16
  require('@weapp-core/regex');
17
+ require('./replace.js');
18
+ require('./shared-r_GpWheO.js');
17
19
  require('@tailwindcss-mangle/shared');
18
- require('lru-cache');
19
- require('md5');
20
20
  require('postcss');
21
- require('./index-CCbEWRGc.js');
21
+ require('./index-B2LUAr--.js');
22
22
  require('@csstools/postcss-is-pseudo-class');
23
23
  require('postcss-rem-to-responsive-pixel');
24
24
  require('postcss-selector-parser');
25
- require('@babel/types');
26
- require('htmlparser2');
27
25
  require('node:path');
28
26
  require('node:process');
29
27
  require('tailwindcss-patch');
28
+ require('@babel/types');
29
+ require('htmlparser2');
30
30
 
31
31
  function createContext(options$1 = {}) {
32
32
  const opts = options.getOptions(options$1);
package/dist/core.mjs CHANGED
@@ -1,28 +1,28 @@
1
- import { g as getOptions } from './options-GppthPlx.mjs';
1
+ import { g as getOptions } from './options-BDij5-AP.mjs';
2
+ import 'lru-cache';
3
+ import 'md5';
4
+ import './defaults-5A8JI2hW.mjs';
5
+ import '@ast-core/escape';
6
+ import '@weapp-core/escape';
7
+ import './defu-n46TJT6t.mjs';
2
8
  import 'magic-string';
3
9
  import '@babel/generator';
4
10
  import '@babel/traverse';
5
11
  import '@babel/parser';
6
- import '@weapp-core/escape';
7
- import '@ast-core/escape';
8
- import './defaults-w3rlKQwe.mjs';
9
- import './defu-n46TJT6t.mjs';
10
- import './replace.mjs';
11
- import './shared-DbJl6i6a.mjs';
12
12
  import '@weapp-core/regex';
13
+ import './replace.mjs';
14
+ import './shared-COWjpokr.mjs';
13
15
  import '@tailwindcss-mangle/shared';
14
- import 'lru-cache';
15
- import 'md5';
16
16
  import 'postcss';
17
- import './index-szMvMylQ.mjs';
17
+ import './index-zFq7tKDr.mjs';
18
18
  import '@csstools/postcss-is-pseudo-class';
19
19
  import 'postcss-rem-to-responsive-pixel';
20
20
  import 'postcss-selector-parser';
21
- import '@babel/types';
22
- import 'htmlparser2';
23
21
  import 'node:path';
24
22
  import 'node:process';
25
23
  import 'tailwindcss-patch';
24
+ import '@babel/types';
25
+ import 'htmlparser2';
26
26
 
27
27
  function createContext(options = {}) {
28
28
  const opts = getOptions(options);
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var defu = require('../defu-Cdz2PomB.js');
3
4
  var plugin = require('tailwindcss/plugin');
4
5
  var constants = require('../constants-CFM1J-h1.js');
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 }; }
8
8
 
@@ -1,6 +1,6 @@
1
+ import { d as defu } from '../defu-n46TJT6t.mjs';
1
2
  import plugin from 'tailwindcss/plugin';
2
3
  import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-Dy2Dd3Fz.mjs';
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, {
@@ -1,6 +1,6 @@
1
- import { c as createDefu } from './defu-n46TJT6t.mjs';
2
- import { SimpleMappingChars2String } from '@weapp-core/escape';
3
1
  import '@ast-core/escape';
2
+ import { SimpleMappingChars2String } from '@weapp-core/escape';
3
+ import { c as createDefu } from './defu-n46TJT6t.mjs';
4
4
 
5
5
  function isMap(value) {
6
6
  return Object.prototype.toString.call(value) === '[object Map]';
@@ -56,7 +56,7 @@ const defuOverrideArray = createDefu((obj, key, value) => {
56
56
 
57
57
  const defaultOptions = {
58
58
  cssMatcher: file => /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/.test(file),
59
- htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty)ml|swan)$/.test(file),
59
+ htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/.test(file),
60
60
  jsMatcher: (file) => {
61
61
  if (file.includes('node_modules')) {
62
62
  return false;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var defu = require('./defu-Cdz2PomB.js');
4
- var escape = require('@weapp-core/escape');
5
3
  require('@ast-core/escape');
4
+ var escape = require('@weapp-core/escape');
5
+ var defu = require('./defu-Cdz2PomB.js');
6
6
 
7
7
  function isMap(value) {
8
8
  return Object.prototype.toString.call(value) === '[object Map]';
@@ -58,7 +58,7 @@ const defuOverrideArray = defu.createDefu((obj, key, value) => {
58
58
 
59
59
  const defaultOptions = {
60
60
  cssMatcher: file => /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/.test(file),
61
- htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty)ml|swan)$/.test(file),
61
+ htmlMatcher: file => /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/.test(file),
62
62
  jsMatcher: (file) => {
63
63
  if (file.includes('node_modules')) {
64
64
  return false;
package/dist/defaults.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var defaults = require('./defaults-DW-EahCC.js');
6
- require('@weapp-core/escape');
7
5
  require('@ast-core/escape');
6
+ require('@weapp-core/escape');
7
+ var defaults = require('./defaults-CdqzSWsR.js');
8
8
  require('./defu-Cdz2PomB.js');
9
9
 
10
10
 
package/dist/defaults.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { a as defaultOptions } from './defaults-w3rlKQwe.mjs';
2
- import '@weapp-core/escape';
3
1
  import '@ast-core/escape';
2
+ import '@weapp-core/escape';
3
+ export { a as defaultOptions } from './defaults-5A8JI2hW.mjs';
4
4
  import './defu-n46TJT6t.mjs';
package/dist/escape.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from '@weapp-core/escape';
2
1
  export { jsStringEscape } from '@ast-core/escape';
2
+ export * from '@weapp-core/escape';
3
3
  export declare function decodeUnicode(s: string): string;
4
4
  export declare function decodeUnicode2(input: string): any;
package/dist/gulp.js CHANGED
@@ -2,34 +2,34 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-Dm02XDmu.js');
6
- require('./options-Uv-owbdp.js');
5
+ var index = require('./index-Dbbfs_Dv.js');
6
+ require('./options-DslwksAa.js');
7
+ require('lru-cache');
8
+ require('md5');
9
+ require('./defaults-CdqzSWsR.js');
10
+ require('@ast-core/escape');
11
+ require('@weapp-core/escape');
12
+ require('./defu-Cdz2PomB.js');
7
13
  require('magic-string');
8
14
  require('@babel/generator');
9
15
  require('@babel/traverse');
10
16
  require('@babel/parser');
11
- require('@weapp-core/escape');
12
- require('@ast-core/escape');
13
- require('./defaults-DW-EahCC.js');
14
- require('./defu-Cdz2PomB.js');
15
- require('./replace.js');
16
- require('./shared-hzYeE1wX.js');
17
17
  require('@weapp-core/regex');
18
+ require('./replace.js');
19
+ require('./shared-r_GpWheO.js');
18
20
  require('@tailwindcss-mangle/shared');
19
- require('lru-cache');
20
- require('md5');
21
21
  require('postcss');
22
- require('./index-CCbEWRGc.js');
22
+ require('./index-B2LUAr--.js');
23
23
  require('@csstools/postcss-is-pseudo-class');
24
24
  require('postcss-rem-to-responsive-pixel');
25
25
  require('postcss-selector-parser');
26
- require('@babel/types');
27
- require('htmlparser2');
28
26
  require('node:path');
29
27
  require('node:process');
30
28
  require('tailwindcss-patch');
31
- require('node:stream');
29
+ require('@babel/types');
30
+ require('htmlparser2');
32
31
  require('node:buffer');
32
+ require('node:stream');
33
33
  require('./index-HC-Qkn0i.js');
34
34
  require('debug');
35
35
 
package/dist/gulp.mjs CHANGED
@@ -1,30 +1,30 @@
1
- export { c as createPlugins } from './index-CvOeCzMu.mjs';
2
- import './options-GppthPlx.mjs';
1
+ export { c as createPlugins } from './index-BOz3IEuV.mjs';
2
+ import './options-BDij5-AP.mjs';
3
+ import 'lru-cache';
4
+ import 'md5';
5
+ import './defaults-5A8JI2hW.mjs';
6
+ import '@ast-core/escape';
7
+ import '@weapp-core/escape';
8
+ import './defu-n46TJT6t.mjs';
3
9
  import 'magic-string';
4
10
  import '@babel/generator';
5
11
  import '@babel/traverse';
6
12
  import '@babel/parser';
7
- import '@weapp-core/escape';
8
- import '@ast-core/escape';
9
- import './defaults-w3rlKQwe.mjs';
10
- import './defu-n46TJT6t.mjs';
11
- import './replace.mjs';
12
- import './shared-DbJl6i6a.mjs';
13
13
  import '@weapp-core/regex';
14
+ import './replace.mjs';
15
+ import './shared-COWjpokr.mjs';
14
16
  import '@tailwindcss-mangle/shared';
15
- import 'lru-cache';
16
- import 'md5';
17
17
  import 'postcss';
18
- import './index-szMvMylQ.mjs';
18
+ import './index-zFq7tKDr.mjs';
19
19
  import '@csstools/postcss-is-pseudo-class';
20
20
  import 'postcss-rem-to-responsive-pixel';
21
21
  import 'postcss-selector-parser';
22
- import '@babel/types';
23
- import 'htmlparser2';
24
22
  import 'node:path';
25
23
  import 'node:process';
26
24
  import 'tailwindcss-patch';
27
- import 'node:stream';
25
+ import '@babel/types';
26
+ import 'htmlparser2';
28
27
  import 'node:buffer';
28
+ import 'node:stream';
29
29
  import './index-BEIjgKpF.mjs';
30
30
  import 'debug';
@@ -2,9 +2,9 @@
2
2
 
3
3
  var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
4
4
  var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
5
- var selectorParser = require('postcss-selector-parser');
6
- var shared = require('./shared-hzYeE1wX.js');
7
5
  var postcss = require('postcss');
6
+ var selectorParser = require('postcss-selector-parser');
7
+ var shared = require('./shared-r_GpWheO.js');
8
8
 
9
9
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
10
10
 
@@ -12,77 +12,27 @@ var postcssIsPseudoClass__default = /*#__PURE__*/_interopDefaultCompat(postcssIs
12
12
  var postcssRem2rpx__default = /*#__PURE__*/_interopDefaultCompat(postcssRem2rpx);
13
13
  var selectorParser__default = /*#__PURE__*/_interopDefaultCompat(selectorParser);
14
14
 
15
- function createRuleTransform(rule, options) {
16
- const { escapeMap, mangleContext, cssSelectorReplacement, cssRemoveHoverPseudoClass } = options;
17
- const transform = (selectors) => {
18
- selectors.walk((selector) => {
19
- if (selector.type === 'universal' && cssSelectorReplacement && cssSelectorReplacement.universal) {
20
- selector.value = shared.composeIsPseudo(cssSelectorReplacement.universal);
21
- }
22
- if (cssRemoveHoverPseudoClass && selector.type === 'selector') {
23
- const node = selector.nodes.find(x => x.type === 'pseudo' && x.value === ':hover');
24
- if (node) {
25
- selector.remove();
26
- }
27
- }
28
- if (selector.type === 'pseudo'
29
- && selector.value === ':root'
30
- && cssSelectorReplacement
31
- && cssSelectorReplacement.root) {
32
- selector.value = shared.composeIsPseudo(cssSelectorReplacement.root);
33
- }
34
- if (selector.type === 'class') {
35
- selector.value = shared.internalCssSelectorReplacer(selector.value, {
36
- escapeMap,
37
- mangleContext,
38
- });
39
- }
40
- });
41
- if (selectors.length === 0) {
42
- rule.remove();
43
- }
15
+ const VariablesScopeSymbol = Symbol('VariablesScope');
16
+
17
+ function createContext() {
18
+ const variablesScopeWeakMap = new WeakMap();
19
+ function isVariablesScope(rule) {
20
+ return variablesScopeWeakMap.get(rule) === VariablesScopeSymbol;
21
+ }
22
+ function markVariablesScope(rule) {
23
+ variablesScopeWeakMap.set(rule, VariablesScopeSymbol);
24
+ }
25
+ return {
26
+ variablesScopeWeakMap,
27
+ isVariablesScope,
28
+ markVariablesScope,
44
29
  };
45
- return transform;
46
30
  }
47
- function getRuleTransformer(rule, options) {
48
- return selectorParser__default["default"](createRuleTransform(rule, options));
49
- }
50
- function ruleTransformSync(rule, options) {
51
- const transformer = getRuleTransformer(rule, options);
52
- return transformer.transformSync(rule, {
53
- lossless: false,
54
- updateSelector: true,
55
- });
56
- }
57
- function isOnlyBeforeAndAfterPseudoElement(node) {
58
- let b = false;
59
- let a = false;
60
- selectorParser__default["default"]((selectors) => {
61
- selectors.walkPseudos((s) => {
62
- var _a;
63
- if (((_a = s.parent) === null || _a === void 0 ? void 0 : _a.length) === 1) {
64
- if (/^:?:before$/.test(s.value)) {
65
- b = true;
66
- }
67
- if (/^:?:after$/.test(s.value)) {
68
- a = true;
69
- }
70
- }
71
- });
72
- }).astSync(node);
73
- return b && a;
74
- }
75
- const fallbackRemove = selectorParser__default["default"]((selectors) => {
76
- selectors.walk((selector) => {
77
- var _a, _b;
78
- if (selector.type === 'universal') {
79
- (_a = selector.parent) === null || _a === void 0 ? void 0 : _a.remove();
80
- }
81
- if (selector.type === 'pseudo' && selector.value === ':is') {
82
- (_b = selector.parent) === null || _b === void 0 ? void 0 : _b.remove();
83
- }
84
- });
85
- });
31
+
32
+ const postcssPlugin = 'postcss-weapp-tailwindcss-rename-plugin';
33
+ const pluginName = 'weapp-tailwindcss-webpack-plugin';
34
+ const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
35
+ const WEAPP_TW_REQUIRED_NODE_VERSION = '16.6.0';
86
36
 
87
37
  var cssVars = [
88
38
  {
@@ -291,6 +241,78 @@ var cssVars = [
291
241
  },
292
242
  ];
293
243
 
244
+ function createRuleTransform(rule, options) {
245
+ const { escapeMap, mangleContext, cssSelectorReplacement, cssRemoveHoverPseudoClass } = options;
246
+ const transform = (selectors) => {
247
+ selectors.walk((selector) => {
248
+ if (selector.type === 'universal' && cssSelectorReplacement && cssSelectorReplacement.universal) {
249
+ selector.value = shared.composeIsPseudo(cssSelectorReplacement.universal);
250
+ }
251
+ if (cssRemoveHoverPseudoClass && selector.type === 'selector') {
252
+ const node = selector.nodes.find(x => x.type === 'pseudo' && x.value === ':hover');
253
+ if (node) {
254
+ selector.remove();
255
+ }
256
+ }
257
+ if (selector.type === 'pseudo'
258
+ && selector.value === ':root'
259
+ && cssSelectorReplacement
260
+ && cssSelectorReplacement.root) {
261
+ selector.value = shared.composeIsPseudo(cssSelectorReplacement.root);
262
+ }
263
+ if (selector.type === 'class') {
264
+ selector.value = shared.internalCssSelectorReplacer(selector.value, {
265
+ escapeMap,
266
+ mangleContext,
267
+ });
268
+ }
269
+ });
270
+ if (selectors.length === 0) {
271
+ rule.remove();
272
+ }
273
+ };
274
+ return transform;
275
+ }
276
+ function getRuleTransformer(rule, options) {
277
+ return selectorParser__default["default"](createRuleTransform(rule, options));
278
+ }
279
+ function ruleTransformSync(rule, options) {
280
+ const transformer = getRuleTransformer(rule, options);
281
+ return transformer.transformSync(rule, {
282
+ lossless: false,
283
+ updateSelector: true,
284
+ });
285
+ }
286
+ function isOnlyBeforeAndAfterPseudoElement(node) {
287
+ let b = false;
288
+ let a = false;
289
+ selectorParser__default["default"]((selectors) => {
290
+ selectors.walkPseudos((s) => {
291
+ var _a;
292
+ if (((_a = s.parent) === null || _a === void 0 ? void 0 : _a.length) === 1) {
293
+ if (/^:?:before$/.test(s.value)) {
294
+ b = true;
295
+ }
296
+ if (/^:?:after$/.test(s.value)) {
297
+ a = true;
298
+ }
299
+ }
300
+ });
301
+ }).astSync(node);
302
+ return b && a;
303
+ }
304
+ const fallbackRemove = selectorParser__default["default"]((selectors) => {
305
+ selectors.walk((selector) => {
306
+ var _a, _b;
307
+ if (selector.type === 'universal') {
308
+ (_a = selector.parent) === null || _a === void 0 ? void 0 : _a.remove();
309
+ }
310
+ if (selector.type === 'pseudo' && selector.value === ':is') {
311
+ (_b = selector.parent) === null || _b === void 0 ? void 0 : _b.remove();
312
+ }
313
+ });
314
+ });
315
+
294
316
  const initialNodes = cssVars.map((x) => {
295
317
  return new postcss.Declaration({
296
318
  prop: x.prop,
@@ -403,46 +425,6 @@ function commonChunkPreflight(node, options) {
403
425
  }
404
426
  }
405
427
 
406
- const postcssPlugin = 'postcss-weapp-tailwindcss-rename-plugin';
407
- const pluginName = 'weapp-tailwindcss-webpack-plugin';
408
- const vitePluginName = 'vite-plugin-uni-app-weapp-tailwindcss-adaptor';
409
- const WEAPP_TW_REQUIRED_NODE_VERSION = '16.6.0';
410
-
411
- function isAtMediaHover(atRule) {
412
- return (/media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name)
413
- || (atRule.name === 'media' && /\(\s*hover\s*:\s*hover\s*\)/.test(atRule.params)));
414
- }
415
- const postcssWeappTailwindcssPrePlugin = (options = {
416
- isMainChunk: true,
417
- }) => {
418
- const { isMainChunk } = options;
419
- const p = {
420
- postcssPlugin,
421
- Rule(rule) {
422
- ruleTransformSync(rule, options);
423
- },
424
- AtRule(atRule) {
425
- if (isAtMediaHover(atRule)) {
426
- if (atRule.nodes) {
427
- atRule.replaceWith(atRule.nodes);
428
- }
429
- else {
430
- atRule.remove();
431
- }
432
- }
433
- },
434
- };
435
- if (isMainChunk) {
436
- p.Once = (root) => {
437
- root.walkRules((rule) => {
438
- commonChunkPreflight(rule, options);
439
- });
440
- };
441
- }
442
- return p;
443
- };
444
- postcssWeappTailwindcssPrePlugin.postcss = true;
445
-
446
428
  const postcssWeappTailwindcssPostPlugin = (options = {
447
429
  isMainChunk: true,
448
430
  }) => {
@@ -479,22 +461,40 @@ const postcssWeappTailwindcssPostPlugin = (options = {
479
461
  };
480
462
  postcssWeappTailwindcssPostPlugin.postcss = true;
481
463
 
482
- const VariablesScopeSymbol = Symbol('VariablesScope');
483
-
484
- function createContext() {
485
- const variablesScopeWeakMap = new WeakMap();
486
- function isVariablesScope(rule) {
487
- return variablesScopeWeakMap.get(rule) === VariablesScopeSymbol;
488
- }
489
- function markVariablesScope(rule) {
490
- variablesScopeWeakMap.set(rule, VariablesScopeSymbol);
491
- }
492
- return {
493
- variablesScopeWeakMap,
494
- isVariablesScope,
495
- markVariablesScope,
496
- };
464
+ function isAtMediaHover(atRule) {
465
+ return (/media\(\s*hover\s*:\s*hover\s*\)/.test(atRule.name)
466
+ || (atRule.name === 'media' && /\(\s*hover\s*:\s*hover\s*\)/.test(atRule.params)));
497
467
  }
468
+ const postcssWeappTailwindcssPrePlugin = (options = {
469
+ isMainChunk: true,
470
+ }) => {
471
+ const { isMainChunk } = options;
472
+ const p = {
473
+ postcssPlugin,
474
+ Rule(rule) {
475
+ ruleTransformSync(rule, options);
476
+ },
477
+ AtRule(atRule) {
478
+ if (isAtMediaHover(atRule)) {
479
+ if (atRule.nodes) {
480
+ atRule.replaceWith(atRule.nodes);
481
+ }
482
+ else {
483
+ atRule.remove();
484
+ }
485
+ }
486
+ },
487
+ };
488
+ if (isMainChunk) {
489
+ p.Once = (root) => {
490
+ root.walkRules((rule) => {
491
+ commonChunkPreflight(rule, options);
492
+ });
493
+ };
494
+ }
495
+ return p;
496
+ };
497
+ postcssWeappTailwindcssPrePlugin.postcss = true;
498
498
 
499
499
  function getPlugins(options) {
500
500
  var _a, _b;
@@ -1,6 +1,6 @@
1
- import { g as getOptions, _ as __awaiter } from './options-GppthPlx.mjs';
2
- import stream from 'node:stream';
1
+ import { g as getOptions, _ as __awaiter } from './options-BDij5-AP.mjs';
3
2
  import { Buffer } from 'node:buffer';
3
+ import stream from 'node:stream';
4
4
  import { c as createDebug } from './index-BEIjgKpF.mjs';
5
5
 
6
6
  const debug = createDebug();
@@ -1,7 +1,7 @@
1
- import { g as getOptions, _ as __awaiter } from './options-GppthPlx.mjs';
2
- import { v as vitePluginName } from './index-szMvMylQ.mjs';
3
- import { g as getGroupedEntries } from './defaults-w3rlKQwe.mjs';
1
+ import { g as getOptions, _ as __awaiter } from './options-BDij5-AP.mjs';
2
+ import { v as vitePluginName } from './index-zFq7tKDr.mjs';
4
3
  import { c as createDebug } from './index-BEIjgKpF.mjs';
4
+ import { g as getGroupedEntries } from './defaults-5A8JI2hW.mjs';
5
5
 
6
6
  const debug = createDebug();
7
7
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-Uv-owbdp.js');
4
- var index = require('./index-CCbEWRGc.js');
5
- var defaults = require('./defaults-DW-EahCC.js');
3
+ var options = require('./options-DslwksAa.js');
4
+ var index = require('./index-B2LUAr--.js');
6
5
  var index$1 = require('./index-HC-Qkn0i.js');
6
+ var defaults = require('./defaults-CdqzSWsR.js');
7
7
 
8
8
  const debug = index$1.createDebug();
9
9
  function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-Uv-owbdp.js');
4
- var stream = require('node:stream');
3
+ var options = require('./options-DslwksAa.js');
5
4
  var node_buffer = require('node:buffer');
5
+ var stream = require('node:stream');
6
6
  var index = require('./index-HC-Qkn0i.js');
7
7
 
8
8
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }