weapp-tailwindcss 3.0.9 → 3.0.11

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 (50) hide show
  1. package/dist/cache/index.d.ts +2 -1
  2. package/dist/cli.js +5 -5
  3. package/dist/cli.mjs +5 -5
  4. package/dist/core.js +5 -5
  5. package/dist/core.mjs +5 -5
  6. package/dist/css-macro/index.js +2 -2
  7. package/dist/css-macro/index.mjs +2 -2
  8. package/dist/css-macro/postcss.js +4 -4
  9. package/dist/css-macro/postcss.mjs +4 -4
  10. package/dist/{defaults-1lCMiqik.js → defaults-BT3A8Rzc.js} +1 -1
  11. package/dist/{defaults-c-Db9ovX.mjs → defaults-CBb6_9nJ.mjs} +1 -1
  12. package/dist/defaults.js +2 -2
  13. package/dist/defaults.mjs +2 -2
  14. package/dist/gulp.js +8 -6
  15. package/dist/gulp.mjs +8 -6
  16. package/dist/{index-63THS8xH.js → index-BgWX0vrB.js} +5 -5
  17. package/dist/{index-Fkmyt0Rc.js → index-CarwQa1I.js} +7 -3
  18. package/dist/index-CgOpm8dH.mjs +130 -0
  19. package/dist/{index-06BoOZig.mjs → index-CsZGfl55.mjs} +3 -2
  20. package/dist/{index-KDDyuNhv.mjs → index-DG4lzarS.mjs} +5 -5
  21. package/dist/{index-_74RBzwy.mjs → index-DKNUquoz.mjs} +7 -3
  22. package/dist/{index-juOeq2Kt.js → index-DyK5Vd4R.js} +3 -2
  23. package/dist/index-FotLKQvj.js +136 -0
  24. package/dist/index.js +9 -9
  25. package/dist/index.mjs +9 -9
  26. package/dist/js/handlers.d.ts +1 -1
  27. package/dist/{options-Z3Pay3SJ.mjs → options-D8LYG9j8.mjs} +42 -38
  28. package/dist/{options-ymQS0nTj.js → options-Zf1-GLWG.js} +42 -38
  29. package/dist/postcss.js +2 -2
  30. package/dist/postcss.mjs +2 -2
  31. package/dist/replace.js +1 -1
  32. package/dist/replace.mjs +1 -1
  33. package/dist/types.d.ts +4 -2
  34. package/dist/{v5-uxlJgYR1.mjs → v5-B8nkZNYC.mjs} +5 -5
  35. package/dist/{v5-wLmuN-qW.js → v5-eVqDacrp.js} +5 -5
  36. package/dist/vite.js +7 -7
  37. package/dist/vite.mjs +7 -7
  38. package/dist/webpack.js +7 -7
  39. package/dist/webpack.mjs +7 -7
  40. package/dist/webpack4.js +7 -7
  41. package/dist/webpack4.mjs +7 -7
  42. package/package.json +34 -34
  43. package/dist/index-JQFi9orv.js +0 -70
  44. package/dist/index-q-Es6emh.mjs +0 -64
  45. /package/dist/{constants-ol1NPf7z.mjs → constants-CcqTvLgQ.mjs} +0 -0
  46. /package/dist/{constants-EVxkHOXL.js → constants-D-YMDg7M.js} +0 -0
  47. /package/dist/{defu-6bFjC68s.js → defu-Cdz2PomB.js} +0 -0
  48. /package/dist/{defu-p1R_k1Ss.mjs → defu-n46TJT6t.mjs} +0 -0
  49. /package/dist/{shared-AxeHlAoJ.js → shared-BDew1Ric.js} +0 -0
  50. /package/dist/{shared-0D5OOeXo.mjs → shared-BX0VV-pr.mjs} +0 -0
@@ -26,5 +26,6 @@ export interface ICreateCacheReturnType {
26
26
  source: CacheValue;
27
27
  }>) => void | Promise<void>;
28
28
  }
29
- declare function createCache(): ICreateCacheReturnType;
29
+ export type ICreateCacheOptions = boolean;
30
+ declare function createCache(options?: ICreateCacheOptions): ICreateCacheReturnType;
30
31
  export { createCache };
package/dist/cli.js CHANGED
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
3
  var semver = require('semver');
4
- var options = require('./options-ymQS0nTj.js');
5
- var index = require('./index-Fkmyt0Rc.js');
4
+ var options = require('./options-Zf1-GLWG.js');
5
+ var index = require('./index-CarwQa1I.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-AxeHlAoJ.js');
10
+ require('./shared-BDew1Ric.js');
11
11
  require('@weapp-core/regex');
12
12
  require('@babel/generator');
13
13
  require('@babel/parser');
14
14
  require('@babel/traverse');
15
- require('./defaults-1lCMiqik.js');
16
- require('./defu-6bFjC68s.js');
15
+ require('./defaults-BT3A8Rzc.js');
16
+ require('./defu-Cdz2PomB.js');
17
17
  require('@babel/types');
18
18
  require('htmlparser2');
19
19
  require('postcss');
package/dist/cli.mjs CHANGED
@@ -1,17 +1,17 @@
1
1
  import semver from 'semver';
2
- import { g as getOptions, a as createPatch } from './options-Z3Pay3SJ.mjs';
3
- import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-_74RBzwy.mjs';
2
+ import { g as getOptions, a as createPatch } from './options-D8LYG9j8.mjs';
3
+ import { W as WEAPP_TW_REQUIRED_NODE_VERSION } from './index-DKNUquoz.mjs';
4
4
  import 'magic-string';
5
5
  import './replace.mjs';
6
6
  import '@weapp-core/escape';
7
7
  import '@ast-core/escape';
8
- import './shared-0D5OOeXo.mjs';
8
+ import './shared-BX0VV-pr.mjs';
9
9
  import '@weapp-core/regex';
10
10
  import '@babel/generator';
11
11
  import '@babel/parser';
12
12
  import '@babel/traverse';
13
- import './defaults-c-Db9ovX.mjs';
14
- import './defu-p1R_k1Ss.mjs';
13
+ import './defaults-CBb6_9nJ.mjs';
14
+ import './defu-n46TJT6t.mjs';
15
15
  import '@babel/types';
16
16
  import 'htmlparser2';
17
17
  import 'postcss';
package/dist/core.js CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var options = require('./options-ymQS0nTj.js');
5
+ var options = require('./options-Zf1-GLWG.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-AxeHlAoJ.js');
10
+ require('./shared-BDew1Ric.js');
11
11
  require('@weapp-core/regex');
12
12
  require('@babel/generator');
13
13
  require('@babel/parser');
14
14
  require('@babel/traverse');
15
- require('./defaults-1lCMiqik.js');
16
- require('./defu-6bFjC68s.js');
15
+ require('./defaults-BT3A8Rzc.js');
16
+ require('./defu-Cdz2PomB.js');
17
17
  require('@babel/types');
18
18
  require('htmlparser2');
19
19
  require('postcss');
20
- require('./index-Fkmyt0Rc.js');
20
+ require('./index-CarwQa1I.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,19 +1,19 @@
1
- import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Z3Pay3SJ.mjs';
1
+ import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.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-0D5OOeXo.mjs';
6
+ import './shared-BX0VV-pr.mjs';
7
7
  import '@weapp-core/regex';
8
8
  import '@babel/generator';
9
9
  import '@babel/parser';
10
10
  import '@babel/traverse';
11
- import './defaults-c-Db9ovX.mjs';
12
- import './defu-p1R_k1Ss.mjs';
11
+ import './defaults-CBb6_9nJ.mjs';
12
+ import './defu-n46TJT6t.mjs';
13
13
  import '@babel/types';
14
14
  import 'htmlparser2';
15
15
  import 'postcss';
16
- import './index-_74RBzwy.mjs';
16
+ import './index-DKNUquoz.mjs';
17
17
  import '@csstools/postcss-is-pseudo-class';
18
18
  import 'postcss-rem-to-responsive-pixel';
19
19
  import 'postcss-selector-parser';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var plugin = require('tailwindcss/plugin');
4
- var constants = require('../constants-EVxkHOXL.js');
5
- var defu = require('../defu-6bFjC68s.js');
4
+ var constants = require('../constants-D-YMDg7M.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
1
  import plugin from 'tailwindcss/plugin';
2
- import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-ol1NPf7z.mjs';
3
- import { d as defu } from '../defu-p1R_k1Ss.mjs';
2
+ import { c as createMediaQuery, a as createNegativeMediaQuery } from '../constants-CcqTvLgQ.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
1
  'use strict';
2
2
 
3
- var constants = require('../constants-EVxkHOXL.js');
3
+ var constants = require('../constants-D-YMDg7M.js');
4
4
 
5
5
  const creator = () => {
6
6
  return {
@@ -8,6 +8,7 @@ const creator = () => {
8
8
  prepare() {
9
9
  return {
10
10
  AtRule(atRule, helper) {
11
+ var _a;
11
12
  if (atRule.name === 'media') {
12
13
  const values = [];
13
14
  constants.matchCustomPropertyFromValue(atRule.params, (arr) => {
@@ -17,14 +18,14 @@ const creator = () => {
17
18
  const isNegative = atRule.params.includes('not');
18
19
  const text = values.join(' ');
19
20
  const comment = isNegative ? constants.ifndef(text) : constants.ifdef(text);
20
- atRule.before([
21
+ atRule.replaceWith([
21
22
  helper.comment({
22
23
  raws: {
23
24
  before: '\n'
24
25
  },
25
26
  text: comment.start
26
27
  }),
27
- ...atRule.nodes,
28
+ ...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
28
29
  helper.comment({
29
30
  raws: {
30
31
  before: '\n'
@@ -32,7 +33,6 @@ const creator = () => {
32
33
  text: comment.end
33
34
  })
34
35
  ]);
35
- atRule.remove();
36
36
  }
37
37
  }
38
38
  },
@@ -1,4 +1,4 @@
1
- import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-ol1NPf7z.mjs';
1
+ import { m as matchCustomPropertyFromValue, i as ifndef, b as ifdef } from '../constants-CcqTvLgQ.mjs';
2
2
 
3
3
  const creator = () => {
4
4
  return {
@@ -6,6 +6,7 @@ const creator = () => {
6
6
  prepare() {
7
7
  return {
8
8
  AtRule(atRule, helper) {
9
+ var _a;
9
10
  if (atRule.name === 'media') {
10
11
  const values = [];
11
12
  matchCustomPropertyFromValue(atRule.params, (arr) => {
@@ -15,14 +16,14 @@ const creator = () => {
15
16
  const isNegative = atRule.params.includes('not');
16
17
  const text = values.join(' ');
17
18
  const comment = isNegative ? ifndef(text) : ifdef(text);
18
- atRule.before([
19
+ atRule.replaceWith([
19
20
  helper.comment({
20
21
  raws: {
21
22
  before: '\n'
22
23
  },
23
24
  text: comment.start
24
25
  }),
25
- ...atRule.nodes,
26
+ ...((_a = atRule.nodes) !== null && _a !== void 0 ? _a : []),
26
27
  helper.comment({
27
28
  raws: {
28
29
  before: '\n'
@@ -30,7 +31,6 @@ const creator = () => {
30
31
  text: comment.end
31
32
  })
32
33
  ]);
33
- atRule.remove();
34
34
  }
35
35
  }
36
36
  },
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var defu = require('./defu-6bFjC68s.js');
3
+ var defu = require('./defu-Cdz2PomB.js');
4
4
  var escape = require('@weapp-core/escape');
5
5
  require('@ast-core/escape');
6
6
 
@@ -1,4 +1,4 @@
1
- import { c as createDefu } from './defu-p1R_k1Ss.mjs';
1
+ import { c as createDefu } from './defu-n46TJT6t.mjs';
2
2
  import { SimpleMappingChars2String } from '@weapp-core/escape';
3
3
  import '@ast-core/escape';
4
4
 
package/dist/defaults.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var defaults = require('./defaults-1lCMiqik.js');
5
+ var defaults = require('./defaults-BT3A8Rzc.js');
6
6
  require('@weapp-core/escape');
7
7
  require('@ast-core/escape');
8
- require('./defu-6bFjC68s.js');
8
+ require('./defu-Cdz2PomB.js');
9
9
 
10
10
 
11
11
 
package/dist/defaults.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { a as defaultOptions } from './defaults-c-Db9ovX.mjs';
1
+ export { a as defaultOptions } from './defaults-CBb6_9nJ.mjs';
2
2
  import '@weapp-core/escape';
3
3
  import '@ast-core/escape';
4
- import './defu-p1R_k1Ss.mjs';
4
+ import './defu-n46TJT6t.mjs';
package/dist/gulp.js CHANGED
@@ -2,23 +2,23 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-JQFi9orv.js');
6
- require('./options-ymQS0nTj.js');
5
+ var index = require('./index-FotLKQvj.js');
6
+ require('./options-Zf1-GLWG.js');
7
7
  require('magic-string');
8
8
  require('./replace.js');
9
9
  require('@weapp-core/escape');
10
10
  require('@ast-core/escape');
11
- require('./shared-AxeHlAoJ.js');
11
+ require('./shared-BDew1Ric.js');
12
12
  require('@weapp-core/regex');
13
13
  require('@babel/generator');
14
14
  require('@babel/parser');
15
15
  require('@babel/traverse');
16
- require('./defaults-1lCMiqik.js');
17
- require('./defu-6bFjC68s.js');
16
+ require('./defaults-BT3A8Rzc.js');
17
+ require('./defu-Cdz2PomB.js');
18
18
  require('@babel/types');
19
19
  require('htmlparser2');
20
20
  require('postcss');
21
- require('./index-Fkmyt0Rc.js');
21
+ require('./index-CarwQa1I.js');
22
22
  require('@csstools/postcss-is-pseudo-class');
23
23
  require('postcss-rem-to-responsive-pixel');
24
24
  require('postcss-selector-parser');
@@ -30,6 +30,8 @@ require('@tailwindcss-mangle/shared');
30
30
  require('lru-cache');
31
31
  require('md5');
32
32
  require('node:stream');
33
+ require('./index-DyK5Vd4R.js');
34
+ require('debug');
33
35
 
34
36
 
35
37
 
package/dist/gulp.mjs CHANGED
@@ -1,20 +1,20 @@
1
- export { c as createPlugins } from './index-q-Es6emh.mjs';
2
- import './options-Z3Pay3SJ.mjs';
1
+ export { c as createPlugins } from './index-CgOpm8dH.mjs';
2
+ import './options-D8LYG9j8.mjs';
3
3
  import 'magic-string';
4
4
  import './replace.mjs';
5
5
  import '@weapp-core/escape';
6
6
  import '@ast-core/escape';
7
- import './shared-0D5OOeXo.mjs';
7
+ import './shared-BX0VV-pr.mjs';
8
8
  import '@weapp-core/regex';
9
9
  import '@babel/generator';
10
10
  import '@babel/parser';
11
11
  import '@babel/traverse';
12
- import './defaults-c-Db9ovX.mjs';
13
- import './defu-p1R_k1Ss.mjs';
12
+ import './defaults-CBb6_9nJ.mjs';
13
+ import './defu-n46TJT6t.mjs';
14
14
  import '@babel/types';
15
15
  import 'htmlparser2';
16
16
  import 'postcss';
17
- import './index-_74RBzwy.mjs';
17
+ import './index-DKNUquoz.mjs';
18
18
  import '@csstools/postcss-is-pseudo-class';
19
19
  import 'postcss-rem-to-responsive-pixel';
20
20
  import 'postcss-selector-parser';
@@ -26,3 +26,5 @@ import '@tailwindcss-mangle/shared';
26
26
  import 'lru-cache';
27
27
  import 'md5';
28
28
  import 'node:stream';
29
+ import './index-CsZGfl55.mjs';
30
+ import 'debug';
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var options = require('./options-ymQS0nTj.js');
4
- var index = require('./index-Fkmyt0Rc.js');
5
- var defaults = require('./defaults-1lCMiqik.js');
6
- var index$1 = require('./index-juOeq2Kt.js');
3
+ var options = require('./options-Zf1-GLWG.js');
4
+ var index = require('./index-CarwQa1I.js');
5
+ var defaults = require('./defaults-BT3A8Rzc.js');
6
+ var index$1 = require('./index-DyK5Vd4R.js');
7
7
 
8
- const debug = index$1.createDebug('generateBundle: ');
8
+ const debug = index$1.createDebug();
9
9
  function UnifiedViteWeappTailwindcssPlugin(options$1 = {}) {
10
10
  if (options$1.customReplaceDictionary === undefined) {
11
11
  options$1.customReplaceDictionary = 'simple';
@@ -3,7 +3,7 @@
3
3
  var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
4
4
  var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
5
5
  var selectorParser = require('postcss-selector-parser');
6
- var shared = require('./shared-AxeHlAoJ.js');
6
+ var shared = require('./shared-BDew1Ric.js');
7
7
  var postcss = require('postcss');
8
8
 
9
9
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
@@ -396,8 +396,12 @@ const postcssWeappTailwindcssPrePlugin = (options = {
396
396
  },
397
397
  AtRule(atRule) {
398
398
  if (isAtMediaHover(atRule)) {
399
- atRule.before(atRule.nodes);
400
- atRule.remove();
399
+ if (atRule.nodes) {
400
+ atRule.replaceWith(atRule.nodes);
401
+ }
402
+ else {
403
+ atRule.remove();
404
+ }
401
405
  }
402
406
  }
403
407
  };
@@ -0,0 +1,130 @@
1
+ import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
2
+ import stream from 'node:stream';
3
+ import { c as createDebug } from './index-CsZGfl55.mjs';
4
+
5
+ const debug = createDebug();
6
+ const Transform = stream.Transform;
7
+ function createPlugins(options = {}) {
8
+ const opts = getOptions(options);
9
+ const { templateHandler, styleHandler, patch, jsHandler, setMangleRuntimeSet, tailwindcssBasedir, cache } = opts;
10
+ let runtimeSet = new Set();
11
+ patch === null || patch === void 0 ? void 0 : patch();
12
+ const twPatcher = createTailwindcssPatcher();
13
+ function transformWxss() {
14
+ return new Transform({
15
+ objectMode: true,
16
+ transform: function (file, encoding, callback) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ runtimeSet = twPatcher.getClassSet({
19
+ basedir: tailwindcssBasedir
20
+ });
21
+ setMangleRuntimeSet(runtimeSet);
22
+ const error = null;
23
+ if (file.contents) {
24
+ const rawSource = file.contents.toString();
25
+ const hash = cache.computeHash(rawSource);
26
+ cache.calcHashValueChanged(file.path, hash);
27
+ yield cache.process(file.path, () => {
28
+ const source = cache.get(file.path);
29
+ if (source) {
30
+ file.contents = Buffer.from(source);
31
+ debug('css cache hit: %s', file.path);
32
+ }
33
+ else {
34
+ return false;
35
+ }
36
+ }, () => __awaiter(this, void 0, void 0, function* () {
37
+ const code = yield styleHandler(rawSource, {
38
+ isMainChunk: true
39
+ });
40
+ file.contents = Buffer.from(code);
41
+ debug('css handle: %s', file.path);
42
+ return {
43
+ key: file.path,
44
+ source: code
45
+ };
46
+ }));
47
+ }
48
+ callback(error, file);
49
+ });
50
+ }
51
+ });
52
+ }
53
+ function transformJs() {
54
+ return new Transform({
55
+ objectMode: true,
56
+ transform: function (file, encoding, callback) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const error = null;
59
+ if (file.contents) {
60
+ const rawSource = file.contents.toString();
61
+ const hash = cache.computeHash(rawSource);
62
+ cache.calcHashValueChanged(file.path, hash);
63
+ yield cache.process(file.path, () => {
64
+ const source = cache.get(file.path);
65
+ if (source) {
66
+ file.contents = Buffer.from(source);
67
+ debug('js cache hit: %s', file.path);
68
+ }
69
+ else {
70
+ return false;
71
+ }
72
+ }, () => {
73
+ const { code } = jsHandler(rawSource, runtimeSet);
74
+ file.contents = Buffer.from(code);
75
+ debug('js handle: %s', file.path);
76
+ return {
77
+ key: file.path,
78
+ source: code
79
+ };
80
+ });
81
+ }
82
+ callback(error, file);
83
+ });
84
+ }
85
+ });
86
+ }
87
+ function transformWxml() {
88
+ return new Transform({
89
+ objectMode: true,
90
+ transform: function (file, encoding, callback) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ const error = null;
93
+ if (file.contents) {
94
+ const rawSource = file.contents.toString();
95
+ const hash = cache.computeHash(rawSource);
96
+ cache.calcHashValueChanged(file.path, hash);
97
+ yield cache.process(file.path, () => {
98
+ const source = cache.get(file.path);
99
+ if (source) {
100
+ file.contents = Buffer.from(source);
101
+ debug('html cache hit: %s', file.path);
102
+ }
103
+ else {
104
+ return false;
105
+ }
106
+ }, () => {
107
+ const code = templateHandler(rawSource, {
108
+ runtimeSet
109
+ });
110
+ file.contents = Buffer.from(code);
111
+ debug('html handle: %s', file.path);
112
+ return {
113
+ key: file.path,
114
+ source: code
115
+ };
116
+ });
117
+ }
118
+ callback(error, file);
119
+ });
120
+ }
121
+ });
122
+ }
123
+ return {
124
+ transformWxss,
125
+ transformWxml,
126
+ transformJs
127
+ };
128
+ }
129
+
130
+ export { createPlugins as c };
@@ -2,9 +2,10 @@ import _createDebug from 'debug';
2
2
 
3
3
  const _debug = _createDebug('weapp-tw');
4
4
  function createDebug(prefix) {
5
- return function debug(formatter, ...args) {
5
+ function debug(formatter, ...args) {
6
6
  return _debug((prefix !== null && prefix !== void 0 ? prefix : '') + formatter, ...args);
7
- };
7
+ }
8
+ return debug;
8
9
  }
9
10
 
10
11
  export { createDebug as c };
@@ -1,9 +1,9 @@
1
- import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-Z3Pay3SJ.mjs';
2
- import { v as vitePluginName } from './index-_74RBzwy.mjs';
3
- import { g as getGroupedEntries } from './defaults-c-Db9ovX.mjs';
4
- import { c as createDebug } from './index-06BoOZig.mjs';
1
+ import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D8LYG9j8.mjs';
2
+ import { v as vitePluginName } from './index-DKNUquoz.mjs';
3
+ import { g as getGroupedEntries } from './defaults-CBb6_9nJ.mjs';
4
+ import { c as createDebug } from './index-CsZGfl55.mjs';
5
5
 
6
- const debug = createDebug('generateBundle: ');
6
+ const debug = createDebug();
7
7
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
8
8
  if (options.customReplaceDictionary === undefined) {
9
9
  options.customReplaceDictionary = 'simple';
@@ -1,7 +1,7 @@
1
1
  import postcssIsPseudoClass from '@csstools/postcss-is-pseudo-class';
2
2
  import postcssRem2rpx from 'postcss-rem-to-responsive-pixel';
3
3
  import selectorParser from 'postcss-selector-parser';
4
- import { c as composeIsPseudo, i as internalCssSelectorReplacer } from './shared-0D5OOeXo.mjs';
4
+ import { c as composeIsPseudo, i as internalCssSelectorReplacer } from './shared-BX0VV-pr.mjs';
5
5
  import { Declaration, Rule } from 'postcss';
6
6
 
7
7
  const createRuleTransform = (rule, options) => {
@@ -388,8 +388,12 @@ const postcssWeappTailwindcssPrePlugin = (options = {
388
388
  },
389
389
  AtRule(atRule) {
390
390
  if (isAtMediaHover(atRule)) {
391
- atRule.before(atRule.nodes);
392
- atRule.remove();
391
+ if (atRule.nodes) {
392
+ atRule.replaceWith(atRule.nodes);
393
+ }
394
+ else {
395
+ atRule.remove();
396
+ }
393
397
  }
394
398
  }
395
399
  };
@@ -8,9 +8,10 @@ var _createDebug__default = /*#__PURE__*/_interopDefaultCompat(_createDebug);
8
8
 
9
9
  const _debug = _createDebug__default["default"]('weapp-tw');
10
10
  function createDebug(prefix) {
11
- return function debug(formatter, ...args) {
11
+ function debug(formatter, ...args) {
12
12
  return _debug((prefix !== null && prefix !== void 0 ? prefix : '') + formatter, ...args);
13
- };
13
+ }
14
+ return debug;
14
15
  }
15
16
 
16
17
  exports.createDebug = createDebug;