weapp-tailwindcss 4.0.9 → 4.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.
@@ -3,7 +3,7 @@
3
3
  var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
4
4
 
5
5
 
6
- var _chunk2GAF453Ajs = require('./chunk-2GAF453A.js');
6
+ var _chunkT7PCCJBLjs = require('./chunk-T7PCCJBL.js');
7
7
 
8
8
  // src/bundlers/gulp/index.ts
9
9
  var _buffer = require('buffer');
@@ -11,7 +11,7 @@ var _stream = require('stream'); var _stream2 = _interopRequireDefault(_stream);
11
11
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
12
12
  var Transform = _stream2.default.Transform;
13
13
  function createPlugins(options = {}) {
14
- const opts = _chunk2GAF453Ajs.getCompilerContext.call(void 0, options);
14
+ const opts = _chunkT7PCCJBLjs.getCompilerContext.call(void 0, options);
15
15
  const { templateHandler, styleHandler, jsHandler, setMangleRuntimeSet, cache, twPatcher } = opts;
16
16
  let runtimeSet = /* @__PURE__ */ new Set();
17
17
  twPatcher.patch();
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-L7PW3J3N.mjs";
7
7
  import {
8
8
  getCompilerContext
9
- } from "./chunk-3ZZRMLDI.mjs";
9
+ } from "./chunk-OL4UJCXZ.mjs";
10
10
  import {
11
11
  getGroupedEntries
12
12
  } from "./chunk-JXBLHLFR.mjs";
@@ -84,40 +84,42 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
84
84
  let noCachedCount = 0;
85
85
  for (const element of groupedEntries.js) {
86
86
  const [file, originalSource] = element;
87
- const rawSource = originalSource.code;
88
- const hash = cache.computeHash(rawSource);
89
- cache.calcHashValueChanged(file, hash);
90
- await cache.process(
91
- file,
92
- () => {
93
- const source = cache.get(file);
94
- if (source) {
95
- originalSource.code = source;
96
- debug("js cache hit: %s", file);
97
- } else {
98
- return false;
87
+ if (originalSource.type === "chunk") {
88
+ const rawSource = originalSource.code;
89
+ const hash = cache.computeHash(rawSource);
90
+ cache.calcHashValueChanged(file, hash);
91
+ await cache.process(
92
+ file,
93
+ () => {
94
+ const source = cache.get(file);
95
+ if (source) {
96
+ originalSource.code = source;
97
+ debug("js cache hit: %s", file);
98
+ } else {
99
+ return false;
100
+ }
101
+ },
102
+ async () => {
103
+ const mapFilename = `${file}.map`;
104
+ const hasMap = Boolean(bundle[mapFilename]);
105
+ const { code, map } = await jsHandler(rawSource, runtimeSet, {
106
+ generateMap: hasMap
107
+ });
108
+ originalSource.code = code;
109
+ onUpdate(file, rawSource, code);
110
+ debug("js handle: %s", file);
111
+ noCachedCount++;
112
+ if (hasMap && map) {
113
+ ;
114
+ bundle[mapFilename].source = map.toString();
115
+ }
116
+ return {
117
+ key: file,
118
+ source: code
119
+ };
99
120
  }
100
- },
101
- async () => {
102
- const mapFilename = `${file}.map`;
103
- const hasMap = Boolean(bundle[mapFilename]);
104
- const { code, map } = await jsHandler(rawSource, runtimeSet, {
105
- generateMap: hasMap
106
- });
107
- originalSource.code = code;
108
- onUpdate(file, rawSource, code);
109
- debug("js handle: %s", file);
110
- noCachedCount++;
111
- if (hasMap && map) {
112
- ;
113
- bundle[mapFilename].source = map.toString();
114
- }
115
- return {
116
- key: file,
117
- source: code
118
- };
119
- }
120
- );
121
+ );
122
+ }
121
123
  }
122
124
  debug("js handle finish, total: %d, no-cached: %d", groupedEntries.js.length, noCachedCount);
123
125
  }
@@ -6,7 +6,7 @@ var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
6
6
  var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
7
7
 
8
8
 
9
- var _chunk2GAF453Ajs = require('./chunk-2GAF453A.js');
9
+ var _chunkT7PCCJBLjs = require('./chunk-T7PCCJBL.js');
10
10
 
11
11
 
12
12
 
@@ -18,7 +18,7 @@ var _path = require('path'); var _path2 = _interopRequireDefault(_path);
18
18
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
19
19
  var UnifiedWebpackPluginV5 = class {
20
20
  constructor(options = {}) {
21
- this.options = _chunk2GAF453Ajs.getCompilerContext.call(void 0, options);
21
+ this.options = _chunkT7PCCJBLjs.getCompilerContext.call(void 0, options);
22
22
  this.appType = this.options.appType;
23
23
  }
24
24
  apply(compiler) {
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-L7PW3J3N.mjs";
7
7
  import {
8
8
  getCompilerContext
9
- } from "./chunk-3ZZRMLDI.mjs";
9
+ } from "./chunk-OL4UJCXZ.mjs";
10
10
  import {
11
11
  getGroupedEntries,
12
12
  removeExt
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-3AUX4FGE.mjs";
4
4
  import {
5
5
  getCompilerContext
6
- } from "./chunk-3ZZRMLDI.mjs";
6
+ } from "./chunk-OL4UJCXZ.mjs";
7
7
 
8
8
  // src/bundlers/gulp/index.ts
9
9
  import { Buffer } from "node:buffer";
@@ -109,9 +109,11 @@ function getDefaultOptions() {
109
109
  cssRemoveHoverPseudoClass: true,
110
110
  ignoreCallExpressionIdentifiers: _localpkg.isPackageExists.call(void 0, "@weapp-tailwindcss/merge") ? ["twMerge", "twJoin", "cva"] : [],
111
111
  ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
112
- patch: {
113
- filter(className) {
114
- return !_escape.isAllowedClassName.call(void 0, className);
112
+ tailwindcssPatcherOptions: {
113
+ patch: {
114
+ filter(className) {
115
+ return !_escape.isAllowedClassName.call(void 0, className);
116
+ }
115
117
  }
116
118
  }
117
119
  };
@@ -6,7 +6,7 @@ var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
6
6
  var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
7
7
 
8
8
 
9
- var _chunk2GAF453Ajs = require('./chunk-2GAF453A.js');
9
+ var _chunkT7PCCJBLjs = require('./chunk-T7PCCJBL.js');
10
10
 
11
11
 
12
12
  var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
@@ -14,7 +14,7 @@ var _chunkO335YLYHjs = require('./chunk-O335YLYH.js');
14
14
  // src/bundlers/vite/index.ts
15
15
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
16
16
  function UnifiedViteWeappTailwindcssPlugin(options = {}) {
17
- const opts = _chunk2GAF453Ajs.getCompilerContext.call(void 0, options);
17
+ const opts = _chunkT7PCCJBLjs.getCompilerContext.call(void 0, options);
18
18
  const {
19
19
  disabled,
20
20
  onEnd,
@@ -84,40 +84,42 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
84
84
  let noCachedCount = 0;
85
85
  for (const element of groupedEntries.js) {
86
86
  const [file, originalSource] = element;
87
- const rawSource = originalSource.code;
88
- const hash = cache.computeHash(rawSource);
89
- cache.calcHashValueChanged(file, hash);
90
- await cache.process(
91
- file,
92
- () => {
93
- const source = cache.get(file);
94
- if (source) {
95
- originalSource.code = source;
96
- debug("js cache hit: %s", file);
97
- } else {
98
- return false;
87
+ if (originalSource.type === "chunk") {
88
+ const rawSource = originalSource.code;
89
+ const hash = cache.computeHash(rawSource);
90
+ cache.calcHashValueChanged(file, hash);
91
+ await cache.process(
92
+ file,
93
+ () => {
94
+ const source = cache.get(file);
95
+ if (source) {
96
+ originalSource.code = source;
97
+ debug("js cache hit: %s", file);
98
+ } else {
99
+ return false;
100
+ }
101
+ },
102
+ async () => {
103
+ const mapFilename = `${file}.map`;
104
+ const hasMap = Boolean(bundle[mapFilename]);
105
+ const { code, map } = await jsHandler(rawSource, runtimeSet, {
106
+ generateMap: hasMap
107
+ });
108
+ originalSource.code = code;
109
+ onUpdate(file, rawSource, code);
110
+ debug("js handle: %s", file);
111
+ noCachedCount++;
112
+ if (hasMap && map) {
113
+ ;
114
+ bundle[mapFilename].source = map.toString();
115
+ }
116
+ return {
117
+ key: file,
118
+ source: code
119
+ };
99
120
  }
100
- },
101
- async () => {
102
- const mapFilename = `${file}.map`;
103
- const hasMap = Boolean(bundle[mapFilename]);
104
- const { code, map } = await jsHandler(rawSource, runtimeSet, {
105
- generateMap: hasMap
106
- });
107
- originalSource.code = code;
108
- onUpdate(file, rawSource, code);
109
- debug("js handle: %s", file);
110
- noCachedCount++;
111
- if (hasMap && map) {
112
- ;
113
- bundle[mapFilename].source = map.toString();
114
- }
115
- return {
116
- key: file,
117
- source: code
118
- };
119
- }
120
- );
121
+ );
122
+ }
121
123
  }
122
124
  debug("js handle finish, total: %d, no-cached: %d", groupedEntries.js.length, noCachedCount);
123
125
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-Q67IXIAH.mjs";
4
4
  import {
5
5
  getDefaultOptions
6
- } from "./chunk-5LMCSUNK.mjs";
6
+ } from "./chunk-RGDWO3OF.mjs";
7
7
  import {
8
8
  defuOverrideArray,
9
9
  isMap,
@@ -259,26 +259,78 @@ var NodePathWalker = class {
259
259
  this.walkTemplateLiteral(right);
260
260
  }
261
261
  }
262
+ walkLogicalExpression(path2) {
263
+ const left = path2.get("left");
264
+ if (left.isStringLiteral()) {
265
+ this.walkStringLiteral(left);
266
+ } else if (left.isBinaryExpression()) {
267
+ this.walkBinaryExpression(left);
268
+ } else if (left.isTemplateLiteral()) {
269
+ this.walkTemplateLiteral(left);
270
+ } else if (left.isLogicalExpression()) {
271
+ this.walkLogicalExpression(left);
272
+ }
273
+ const right = path2.get("right");
274
+ if (right.isStringLiteral()) {
275
+ this.walkStringLiteral(right);
276
+ } else if (right.isBinaryExpression(right)) {
277
+ this.walkBinaryExpression(right);
278
+ } else if (right.isTemplateLiteral()) {
279
+ this.walkTemplateLiteral(right);
280
+ } else if (right.isLogicalExpression()) {
281
+ this.walkLogicalExpression(right);
282
+ }
283
+ }
284
+ walkObjectExpression(path2) {
285
+ const props = path2.get("properties");
286
+ for (const prop of props) {
287
+ if (prop.isObjectProperty()) {
288
+ const key = prop.get("key");
289
+ if (key) {
290
+ if (key.isStringLiteral()) {
291
+ this.walkStringLiteral(key);
292
+ } else if (key.isTemplateLiteral()) {
293
+ this.walkTemplateLiteral(key);
294
+ }
295
+ }
296
+ }
297
+ }
298
+ }
299
+ walkArrayExpression(path2) {
300
+ const elements = path2.get("elements");
301
+ for (const element of elements) {
302
+ this.composeWalk(element);
303
+ }
304
+ }
305
+ composeWalk(arg) {
306
+ if (arg.isIdentifier()) {
307
+ const binding = arg.scope.getBinding(arg.node.name);
308
+ if (binding) {
309
+ if (binding.path.isVariableDeclarator()) {
310
+ this.walkVariableDeclarator(binding.path);
311
+ }
312
+ }
313
+ } else if (arg.isTemplateLiteral()) {
314
+ this.walkTemplateLiteral(arg);
315
+ } else if (arg.isStringLiteral()) {
316
+ this.walkStringLiteral(arg);
317
+ } else if (arg.isBinaryExpression()) {
318
+ this.walkBinaryExpression(arg);
319
+ } else if (arg.isLogicalExpression()) {
320
+ this.walkLogicalExpression(arg);
321
+ } else if (arg.isObjectExpression()) {
322
+ this.walkObjectExpression(arg);
323
+ } else if (arg.isArrayExpression()) {
324
+ this.walkArrayExpression(arg);
325
+ }
326
+ }
262
327
  walkCallExpression(path2) {
263
328
  const calleePath = path2.get("callee");
264
329
  if (calleePath.isIdentifier() && regExpTest(this.ignoreCallExpressionIdentifiers, calleePath.node.name, {
265
330
  exact: true
266
331
  })) {
267
332
  for (const arg of path2.get("arguments")) {
268
- if (arg.isIdentifier()) {
269
- const binding = arg.scope.getBinding(arg.node.name);
270
- if (binding) {
271
- if (binding.path.isVariableDeclarator()) {
272
- this.walkVariableDeclarator(binding.path);
273
- }
274
- }
275
- } else if (arg.isTemplateLiteral()) {
276
- this.walkTemplateLiteral(arg);
277
- } else if (arg.isStringLiteral()) {
278
- this.walkStringLiteral(arg);
279
- } else if (arg.isBinaryExpression()) {
280
- this.walkBinaryExpression(arg);
281
- }
333
+ this.composeWalk(arg);
282
334
  }
283
335
  }
284
336
  }
@@ -479,7 +531,7 @@ import process from "node:process";
479
531
  import { defuOverrideArray as defuOverrideArray2 } from "@weapp-tailwindcss/shared";
480
532
  import { TailwindcssPatcher } from "tailwindcss-patch";
481
533
  function createTailwindcssPatcher(options) {
482
- const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, patch } = options || {};
534
+ const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, tailwindcssPatcherOptions } = options || {};
483
535
  const cache = {};
484
536
  if (cacheDir) {
485
537
  if (path.isAbsolute(cacheDir)) {
@@ -490,25 +542,25 @@ function createTailwindcssPatcher(options) {
490
542
  cache.dir = path.resolve(process.cwd(), cacheDir);
491
543
  }
492
544
  }
493
- return new TailwindcssPatcher({
494
- cache,
495
- patch: defuOverrideArray2(patch, {
496
- basedir,
497
- applyPatches: {
498
- exportContext: true,
499
- extendLengthUnits: supportCustomLengthUnitsPatch
500
- },
501
- tailwindcss,
502
- resolve: {
503
- paths: [
504
- import.meta.url
505
- ]
545
+ return new TailwindcssPatcher(defuOverrideArray2(
546
+ tailwindcssPatcherOptions,
547
+ {
548
+ cache,
549
+ patch: {
550
+ basedir,
551
+ applyPatches: {
552
+ exportContext: true,
553
+ extendLengthUnits: supportCustomLengthUnitsPatch
554
+ },
555
+ tailwindcss,
556
+ resolve: {
557
+ paths: [
558
+ import.meta.url
559
+ ]
560
+ }
506
561
  }
507
- // filter: (x) => {
508
- // return !isAllowedClassName(x)
509
- // },
510
- })
511
- });
562
+ }
563
+ ));
512
564
  }
513
565
 
514
566
  // src/wxml/utils.ts
@@ -852,7 +904,7 @@ function getCompilerContext(opts) {
852
904
  ignoreTaggedTemplateExpressionIdentifiers,
853
905
  cssPresetEnv,
854
906
  tailwindcss,
855
- patch
907
+ tailwindcssPatcherOptions
856
908
  } = ctx;
857
909
  const customAttributesEntities = isMap(customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
858
910
  const { initMangle, mangleContext, setMangleRuntimeSet } = useMangleStore();
@@ -898,7 +950,7 @@ function getCompilerContext(opts) {
898
950
  cacheDir: appType === "mpx" ? "node_modules/tailwindcss-patch/.cache" : void 0,
899
951
  supportCustomLengthUnitsPatch: supportCustomLengthUnitsPatch ?? true,
900
952
  tailwindcss,
901
- patch
953
+ tailwindcssPatcherOptions
902
954
  }
903
955
  );
904
956
  ctx.setMangleRuntimeSet = setMangleRuntimeSet;
@@ -109,9 +109,11 @@ function getDefaultOptions() {
109
109
  cssRemoveHoverPseudoClass: true,
110
110
  ignoreCallExpressionIdentifiers: isPackageExists("@weapp-tailwindcss/merge") ? ["twMerge", "twJoin", "cva"] : [],
111
111
  ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
112
- patch: {
113
- filter(className) {
114
- return !isAllowedClassName(className);
112
+ tailwindcssPatcherOptions: {
113
+ patch: {
114
+ filter(className) {
115
+ return !isAllowedClassName(className);
116
+ }
115
117
  }
116
118
  }
117
119
  };
@@ -3,7 +3,7 @@
3
3
  var _chunkPLMJW644js = require('./chunk-PLMJW644.js');
4
4
 
5
5
 
6
- var _chunkXWGMPET3js = require('./chunk-XWGMPET3.js');
6
+ var _chunkJC63TIBUjs = require('./chunk-JC63TIBU.js');
7
7
 
8
8
 
9
9
 
@@ -262,26 +262,78 @@ var NodePathWalker = class {
262
262
  this.walkTemplateLiteral(right);
263
263
  }
264
264
  }
265
+ walkLogicalExpression(path2) {
266
+ const left = path2.get("left");
267
+ if (left.isStringLiteral()) {
268
+ this.walkStringLiteral(left);
269
+ } else if (left.isBinaryExpression()) {
270
+ this.walkBinaryExpression(left);
271
+ } else if (left.isTemplateLiteral()) {
272
+ this.walkTemplateLiteral(left);
273
+ } else if (left.isLogicalExpression()) {
274
+ this.walkLogicalExpression(left);
275
+ }
276
+ const right = path2.get("right");
277
+ if (right.isStringLiteral()) {
278
+ this.walkStringLiteral(right);
279
+ } else if (right.isBinaryExpression(right)) {
280
+ this.walkBinaryExpression(right);
281
+ } else if (right.isTemplateLiteral()) {
282
+ this.walkTemplateLiteral(right);
283
+ } else if (right.isLogicalExpression()) {
284
+ this.walkLogicalExpression(right);
285
+ }
286
+ }
287
+ walkObjectExpression(path2) {
288
+ const props = path2.get("properties");
289
+ for (const prop of props) {
290
+ if (prop.isObjectProperty()) {
291
+ const key = prop.get("key");
292
+ if (key) {
293
+ if (key.isStringLiteral()) {
294
+ this.walkStringLiteral(key);
295
+ } else if (key.isTemplateLiteral()) {
296
+ this.walkTemplateLiteral(key);
297
+ }
298
+ }
299
+ }
300
+ }
301
+ }
302
+ walkArrayExpression(path2) {
303
+ const elements = path2.get("elements");
304
+ for (const element of elements) {
305
+ this.composeWalk(element);
306
+ }
307
+ }
308
+ composeWalk(arg) {
309
+ if (arg.isIdentifier()) {
310
+ const binding = arg.scope.getBinding(arg.node.name);
311
+ if (binding) {
312
+ if (binding.path.isVariableDeclarator()) {
313
+ this.walkVariableDeclarator(binding.path);
314
+ }
315
+ }
316
+ } else if (arg.isTemplateLiteral()) {
317
+ this.walkTemplateLiteral(arg);
318
+ } else if (arg.isStringLiteral()) {
319
+ this.walkStringLiteral(arg);
320
+ } else if (arg.isBinaryExpression()) {
321
+ this.walkBinaryExpression(arg);
322
+ } else if (arg.isLogicalExpression()) {
323
+ this.walkLogicalExpression(arg);
324
+ } else if (arg.isObjectExpression()) {
325
+ this.walkObjectExpression(arg);
326
+ } else if (arg.isArrayExpression()) {
327
+ this.walkArrayExpression(arg);
328
+ }
329
+ }
265
330
  walkCallExpression(path2) {
266
331
  const calleePath = path2.get("callee");
267
332
  if (calleePath.isIdentifier() && _chunkO335YLYHjs.regExpTest.call(void 0, this.ignoreCallExpressionIdentifiers, calleePath.node.name, {
268
333
  exact: true
269
334
  })) {
270
335
  for (const arg of path2.get("arguments")) {
271
- if (arg.isIdentifier()) {
272
- const binding = arg.scope.getBinding(arg.node.name);
273
- if (binding) {
274
- if (binding.path.isVariableDeclarator()) {
275
- this.walkVariableDeclarator(binding.path);
276
- }
277
- }
278
- } else if (arg.isTemplateLiteral()) {
279
- this.walkTemplateLiteral(arg);
280
- } else if (arg.isStringLiteral()) {
281
- this.walkStringLiteral(arg);
282
- } else if (arg.isBinaryExpression()) {
283
- this.walkBinaryExpression(arg);
284
- }
336
+ this.composeWalk(arg);
285
337
  }
286
338
  }
287
339
  }
@@ -482,7 +534,7 @@ var _process = require('process'); var _process2 = _interopRequireDefault(_proce
482
534
  var _shared = require('@weapp-tailwindcss/shared');
483
535
  var _tailwindcsspatch = require('tailwindcss-patch');
484
536
  function createTailwindcssPatcher(options) {
485
- const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, patch } = options || {};
537
+ const { basedir, cacheDir, supportCustomLengthUnitsPatch, tailwindcss, tailwindcssPatcherOptions } = options || {};
486
538
  const cache = {};
487
539
  if (cacheDir) {
488
540
  if (_path2.default.isAbsolute(cacheDir)) {
@@ -493,25 +545,25 @@ function createTailwindcssPatcher(options) {
493
545
  cache.dir = _path2.default.resolve(_process2.default.cwd(), cacheDir);
494
546
  }
495
547
  }
496
- return new (0, _tailwindcsspatch.TailwindcssPatcher)({
497
- cache,
498
- patch: _shared.defuOverrideArray.call(void 0, patch, {
499
- basedir,
500
- applyPatches: {
501
- exportContext: true,
502
- extendLengthUnits: supportCustomLengthUnitsPatch
503
- },
504
- tailwindcss,
505
- resolve: {
506
- paths: [
507
- _chunkMY2HTM7Pjs.importMetaUrl
508
- ]
548
+ return new (0, _tailwindcsspatch.TailwindcssPatcher)(_shared.defuOverrideArray.call(void 0,
549
+ tailwindcssPatcherOptions,
550
+ {
551
+ cache,
552
+ patch: {
553
+ basedir,
554
+ applyPatches: {
555
+ exportContext: true,
556
+ extendLengthUnits: supportCustomLengthUnitsPatch
557
+ },
558
+ tailwindcss,
559
+ resolve: {
560
+ paths: [
561
+ _chunkMY2HTM7Pjs.importMetaUrl
562
+ ]
563
+ }
509
564
  }
510
- // filter: (x) => {
511
- // return !isAllowedClassName(x)
512
- // },
513
- })
514
- });
565
+ }
566
+ ));
515
567
  }
516
568
 
517
569
  // src/wxml/utils.ts
@@ -825,7 +877,7 @@ var _postcss = require('@weapp-tailwindcss/postcss');
825
877
  function getCompilerContext(opts) {
826
878
  const ctx = _chunkO335YLYHjs.defuOverrideArray.call(void 0,
827
879
  opts,
828
- _chunkXWGMPET3js.getDefaultOptions.call(void 0, ),
880
+ _chunkJC63TIBUjs.getDefaultOptions.call(void 0, ),
829
881
  {}
830
882
  );
831
883
  ctx.escapeMap = ctx.customReplaceDictionary;
@@ -855,7 +907,7 @@ function getCompilerContext(opts) {
855
907
  ignoreTaggedTemplateExpressionIdentifiers,
856
908
  cssPresetEnv,
857
909
  tailwindcss,
858
- patch
910
+ tailwindcssPatcherOptions
859
911
  } = ctx;
860
912
  const customAttributesEntities = _chunkO335YLYHjs.isMap.call(void 0, customAttributes) ? [...customAttributes.entries()] : Object.entries(customAttributes);
861
913
  const { initMangle, mangleContext, setMangleRuntimeSet } = _mangle.useMangleStore.call(void 0, );
@@ -901,7 +953,7 @@ function getCompilerContext(opts) {
901
953
  cacheDir: appType === "mpx" ? "node_modules/tailwindcss-patch/.cache" : void 0,
902
954
  supportCustomLengthUnitsPatch: _nullishCoalesce(supportCustomLengthUnitsPatch, () => ( true)),
903
955
  tailwindcss,
904
- patch
956
+ tailwindcssPatcherOptions
905
957
  }
906
958
  );
907
959
  ctx.setMangleRuntimeSet = setMangleRuntimeSet;
package/dist/cli.js CHANGED
@@ -3,9 +3,9 @@
3
3
  var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
4
4
 
5
5
 
6
- var _chunk2GAF453Ajs = require('./chunk-2GAF453A.js');
6
+ var _chunkT7PCCJBLjs = require('./chunk-T7PCCJBL.js');
7
7
  require('./chunk-PLMJW644.js');
8
- require('./chunk-XWGMPET3.js');
8
+ require('./chunk-JC63TIBU.js');
9
9
  require('./chunk-O335YLYH.js');
10
10
  require('./chunk-MY2HTM7P.js');
11
11
 
@@ -27,7 +27,7 @@ if (_semver2.default.lt(_process2.default.versions.node, _chunkEHEK77ROjs.WEAPP_
27
27
  }
28
28
  var command = args[0];
29
29
  if (command === "patch") {
30
- const ctx = _chunk2GAF453Ajs.getCompilerContext.call(void 0, );
30
+ const ctx = _chunkT7PCCJBLjs.getCompilerContext.call(void 0, );
31
31
  ctx.twPatcher.patch();
32
32
  } else if (command === "init") {
33
33
  _init.init.call(void 0, );
package/dist/cli.mjs CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  } from "./chunk-L7PW3J3N.mjs";
4
4
  import {
5
5
  getCompilerContext
6
- } from "./chunk-3ZZRMLDI.mjs";
6
+ } from "./chunk-OL4UJCXZ.mjs";
7
7
  import "./chunk-Q67IXIAH.mjs";
8
- import "./chunk-5LMCSUNK.mjs";
8
+ import "./chunk-RGDWO3OF.mjs";
9
9
  import "./chunk-JXBLHLFR.mjs";
10
10
  import "./chunk-4BKXIUVT.mjs";
11
11
 
package/dist/core.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk2GAF453Ajs = require('./chunk-2GAF453A.js');
3
+ var _chunkT7PCCJBLjs = require('./chunk-T7PCCJBL.js');
4
4
  require('./chunk-PLMJW644.js');
5
- require('./chunk-XWGMPET3.js');
5
+ require('./chunk-JC63TIBU.js');
6
6
  require('./chunk-O335YLYH.js');
7
7
  require('./chunk-MY2HTM7P.js');
8
8
 
9
9
  // src/core.ts
10
10
  var _shared = require('@weapp-tailwindcss/shared');
11
11
  function createContext(options = {}) {
12
- const opts = _chunk2GAF453Ajs.getCompilerContext.call(void 0, options);
12
+ const opts = _chunkT7PCCJBLjs.getCompilerContext.call(void 0, options);
13
13
  const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
14
14
  let runtimeSet = /* @__PURE__ */ new Set();
15
15
  twPatcher.patch();
package/dist/core.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getCompilerContext
3
- } from "./chunk-3ZZRMLDI.mjs";
3
+ } from "./chunk-OL4UJCXZ.mjs";
4
4
  import "./chunk-Q67IXIAH.mjs";
5
- import "./chunk-5LMCSUNK.mjs";
5
+ import "./chunk-RGDWO3OF.mjs";
6
6
  import "./chunk-JXBLHLFR.mjs";
7
7
  import "./chunk-4BKXIUVT.mjs";
8
8
 
package/dist/defaults.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXWGMPET3js = require('./chunk-XWGMPET3.js');
3
+ var _chunkJC63TIBUjs = require('./chunk-JC63TIBU.js');
4
4
  require('./chunk-O335YLYH.js');
5
5
  require('./chunk-MY2HTM7P.js');
6
6
 
7
7
 
8
- exports.getDefaultOptions = _chunkXWGMPET3js.getDefaultOptions;
8
+ exports.getDefaultOptions = _chunkJC63TIBUjs.getDefaultOptions;
package/dist/defaults.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDefaultOptions
3
- } from "./chunk-5LMCSUNK.mjs";
3
+ } from "./chunk-RGDWO3OF.mjs";
4
4
  import "./chunk-JXBLHLFR.mjs";
5
5
  import "./chunk-4BKXIUVT.mjs";
6
6
  export {
package/dist/gulp.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkON3RNN73js = require('./chunk-ON3RNN73.js');
3
+ var _chunk3QGYVLHWjs = require('./chunk-3QGYVLHW.js');
4
4
  require('./chunk-LSSLYD6B.js');
5
- require('./chunk-2GAF453A.js');
5
+ require('./chunk-T7PCCJBL.js');
6
6
  require('./chunk-PLMJW644.js');
7
- require('./chunk-XWGMPET3.js');
7
+ require('./chunk-JC63TIBU.js');
8
8
  require('./chunk-O335YLYH.js');
9
9
  require('./chunk-MY2HTM7P.js');
10
10
 
11
11
 
12
- exports.createPlugins = _chunkON3RNN73js.createPlugins;
12
+ exports.createPlugins = _chunk3QGYVLHWjs.createPlugins;
package/dist/gulp.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createPlugins
3
- } from "./chunk-PVQKKTNM.mjs";
3
+ } from "./chunk-HVXW2GUE.mjs";
4
4
  import "./chunk-3AUX4FGE.mjs";
5
- import "./chunk-3ZZRMLDI.mjs";
5
+ import "./chunk-OL4UJCXZ.mjs";
6
6
  import "./chunk-Q67IXIAH.mjs";
7
- import "./chunk-5LMCSUNK.mjs";
7
+ import "./chunk-RGDWO3OF.mjs";
8
8
  import "./chunk-JXBLHLFR.mjs";
9
9
  import "./chunk-4BKXIUVT.mjs";
10
10
  export {
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-O2IOQ3BD.js');
2
2
 
3
3
 
4
- var _chunkTHG3CZVKjs = require('./chunk-THG3CZVK.js');
4
+ var _chunkAJ25FS5Cjs = require('./chunk-AJ25FS5C.js');
5
5
 
6
6
 
7
- var _chunkON3RNN73js = require('./chunk-ON3RNN73.js');
7
+ var _chunk3QGYVLHWjs = require('./chunk-3QGYVLHW.js');
8
8
 
9
9
 
10
- var _chunkDQO4GZQ2js = require('./chunk-DQO4GZQ2.js');
10
+ var _chunkOIPONPHPjs = require('./chunk-OIPONPHP.js');
11
11
  require('./chunk-LSSLYD6B.js');
12
12
  require('./chunk-EHEK77RO.js');
13
- require('./chunk-2GAF453A.js');
13
+ require('./chunk-T7PCCJBL.js');
14
14
  require('./chunk-PLMJW644.js');
15
- require('./chunk-XWGMPET3.js');
15
+ require('./chunk-JC63TIBU.js');
16
16
  require('./chunk-O335YLYH.js');
17
17
  require('./chunk-MY2HTM7P.js');
18
18
 
19
19
 
20
20
 
21
21
 
22
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkDQO4GZQ2js.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkTHG3CZVKjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkON3RNN73js.createPlugins;
22
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkOIPONPHPjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkAJ25FS5Cjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunk3QGYVLHWjs.createPlugins;
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import "./chunk-YAN7TO2B.mjs";
2
2
  import {
3
3
  UnifiedWebpackPluginV5
4
- } from "./chunk-476ON7AU.mjs";
4
+ } from "./chunk-CFOS3UUF.mjs";
5
5
  import {
6
6
  createPlugins
7
- } from "./chunk-PVQKKTNM.mjs";
7
+ } from "./chunk-HVXW2GUE.mjs";
8
8
  import {
9
9
  UnifiedViteWeappTailwindcssPlugin
10
- } from "./chunk-5IA7UA56.mjs";
10
+ } from "./chunk-3WQDHEZ6.mjs";
11
11
  import "./chunk-3AUX4FGE.mjs";
12
12
  import "./chunk-L7PW3J3N.mjs";
13
- import "./chunk-3ZZRMLDI.mjs";
13
+ import "./chunk-OL4UJCXZ.mjs";
14
14
  import "./chunk-Q67IXIAH.mjs";
15
- import "./chunk-5LMCSUNK.mjs";
15
+ import "./chunk-RGDWO3OF.mjs";
16
16
  import "./chunk-JXBLHLFR.mjs";
17
17
  import "./chunk-4BKXIUVT.mjs";
18
18
  export {
package/dist/types.d.mts CHANGED
@@ -5,7 +5,7 @@ import { CssPreflightOptions, LoadedPostcssOptions, CustomRuleCallback, IStyleHa
5
5
  export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
6
6
  import { SourceMap } from 'magic-string';
7
7
  import { Result, Root, Document } from 'postcss';
8
- import { PatchOptions, ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
8
+ import { PatchOptions, ILengthUnitsPatchOptions, TailwindcssPatcherOptions, TailwindcssPatcher } from 'tailwindcss-patch';
9
9
  import { Buffer } from 'node:buffer';
10
10
  import { sources } from 'webpack';
11
11
  import { LRUCache } from 'lru-cache';
@@ -415,7 +415,7 @@ interface UserDefinedOptions {
415
415
  * @group 3.一般配置
416
416
  * @description 自定义 patcher 参数
417
417
  */
418
- patch?: PatchOptions;
418
+ tailwindcssPatcherOptions?: TailwindcssPatcherOptions;
419
419
  }
420
420
  interface UserDefinedOptions {
421
421
  /**
package/dist/types.d.ts CHANGED
@@ -5,7 +5,7 @@ import { CssPreflightOptions, LoadedPostcssOptions, CustomRuleCallback, IStyleHa
5
5
  export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
6
6
  import { SourceMap } from 'magic-string';
7
7
  import { Result, Root, Document } from 'postcss';
8
- import { PatchOptions, ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
8
+ import { PatchOptions, ILengthUnitsPatchOptions, TailwindcssPatcherOptions, TailwindcssPatcher } from 'tailwindcss-patch';
9
9
  import { Buffer } from 'node:buffer';
10
10
  import { sources } from 'webpack';
11
11
  import { LRUCache } from 'lru-cache';
@@ -415,7 +415,7 @@ interface UserDefinedOptions {
415
415
  * @group 3.一般配置
416
416
  * @description 自定义 patcher 参数
417
417
  */
418
- patch?: PatchOptions;
418
+ tailwindcssPatcherOptions?: TailwindcssPatcherOptions;
419
419
  }
420
420
  interface UserDefinedOptions {
421
421
  /**
package/dist/vite.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDQO4GZQ2js = require('./chunk-DQO4GZQ2.js');
3
+ var _chunkOIPONPHPjs = require('./chunk-OIPONPHP.js');
4
4
  require('./chunk-LSSLYD6B.js');
5
5
  require('./chunk-EHEK77RO.js');
6
- require('./chunk-2GAF453A.js');
6
+ require('./chunk-T7PCCJBL.js');
7
7
  require('./chunk-PLMJW644.js');
8
- require('./chunk-XWGMPET3.js');
8
+ require('./chunk-JC63TIBU.js');
9
9
  require('./chunk-O335YLYH.js');
10
10
  require('./chunk-MY2HTM7P.js');
11
11
 
12
12
 
13
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkDQO4GZQ2js.UnifiedViteWeappTailwindcssPlugin;
13
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkOIPONPHPjs.UnifiedViteWeappTailwindcssPlugin;
package/dist/vite.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  UnifiedViteWeappTailwindcssPlugin
3
- } from "./chunk-5IA7UA56.mjs";
3
+ } from "./chunk-3WQDHEZ6.mjs";
4
4
  import "./chunk-3AUX4FGE.mjs";
5
5
  import "./chunk-L7PW3J3N.mjs";
6
- import "./chunk-3ZZRMLDI.mjs";
6
+ import "./chunk-OL4UJCXZ.mjs";
7
7
  import "./chunk-Q67IXIAH.mjs";
8
- import "./chunk-5LMCSUNK.mjs";
8
+ import "./chunk-RGDWO3OF.mjs";
9
9
  import "./chunk-JXBLHLFR.mjs";
10
10
  import "./chunk-4BKXIUVT.mjs";
11
11
  export {
package/dist/webpack.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkTHG3CZVKjs = require('./chunk-THG3CZVK.js');
3
+ var _chunkAJ25FS5Cjs = require('./chunk-AJ25FS5C.js');
4
4
  require('./chunk-LSSLYD6B.js');
5
5
  require('./chunk-EHEK77RO.js');
6
- require('./chunk-2GAF453A.js');
6
+ require('./chunk-T7PCCJBL.js');
7
7
  require('./chunk-PLMJW644.js');
8
- require('./chunk-XWGMPET3.js');
8
+ require('./chunk-JC63TIBU.js');
9
9
  require('./chunk-O335YLYH.js');
10
10
  require('./chunk-MY2HTM7P.js');
11
11
 
12
12
 
13
- exports.UnifiedWebpackPluginV5 = _chunkTHG3CZVKjs.UnifiedWebpackPluginV5;
13
+ exports.UnifiedWebpackPluginV5 = _chunkAJ25FS5Cjs.UnifiedWebpackPluginV5;
package/dist/webpack.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  UnifiedWebpackPluginV5
3
- } from "./chunk-476ON7AU.mjs";
3
+ } from "./chunk-CFOS3UUF.mjs";
4
4
  import "./chunk-3AUX4FGE.mjs";
5
5
  import "./chunk-L7PW3J3N.mjs";
6
- import "./chunk-3ZZRMLDI.mjs";
6
+ import "./chunk-OL4UJCXZ.mjs";
7
7
  import "./chunk-Q67IXIAH.mjs";
8
- import "./chunk-5LMCSUNK.mjs";
8
+ import "./chunk-RGDWO3OF.mjs";
9
9
  import "./chunk-JXBLHLFR.mjs";
10
10
  import "./chunk-4BKXIUVT.mjs";
11
11
  export {
package/dist/webpack4.js CHANGED
@@ -6,9 +6,9 @@ var _chunkLSSLYD6Bjs = require('./chunk-LSSLYD6B.js');
6
6
  var _chunkEHEK77ROjs = require('./chunk-EHEK77RO.js');
7
7
 
8
8
 
9
- var _chunk2GAF453Ajs = require('./chunk-2GAF453A.js');
9
+ var _chunkT7PCCJBLjs = require('./chunk-T7PCCJBL.js');
10
10
  require('./chunk-PLMJW644.js');
11
- require('./chunk-XWGMPET3.js');
11
+ require('./chunk-JC63TIBU.js');
12
12
 
13
13
 
14
14
 
@@ -22,7 +22,7 @@ var _webpacksources = require('webpack-sources');
22
22
  var debug = _chunkLSSLYD6Bjs.createDebug.call(void 0, );
23
23
  var UnifiedWebpackPluginV4 = class {
24
24
  constructor(options = {}) {
25
- this.options = _chunk2GAF453Ajs.getCompilerContext.call(void 0, options);
25
+ this.options = _chunkT7PCCJBLjs.getCompilerContext.call(void 0, options);
26
26
  this.appType = this.options.appType;
27
27
  }
28
28
  apply(compiler) {
package/dist/webpack4.mjs CHANGED
@@ -6,9 +6,9 @@ import {
6
6
  } from "./chunk-L7PW3J3N.mjs";
7
7
  import {
8
8
  getCompilerContext
9
- } from "./chunk-3ZZRMLDI.mjs";
9
+ } from "./chunk-OL4UJCXZ.mjs";
10
10
  import "./chunk-Q67IXIAH.mjs";
11
- import "./chunk-5LMCSUNK.mjs";
11
+ import "./chunk-RGDWO3OF.mjs";
12
12
  import {
13
13
  getGroupedEntries,
14
14
  removeExt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "4.0.9",
3
+ "version": "4.0.11",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -149,17 +149,17 @@
149
149
  "debug": "~4.4.0",
150
150
  "htmlparser2": "10.0.0",
151
151
  "loader-utils": "2.0.4",
152
- "local-pkg": "^1.1.0",
152
+ "local-pkg": "^1.1.1",
153
153
  "lru-cache": "10.4.3",
154
154
  "magic-string": "0.30.17",
155
155
  "md5": "2.3.0",
156
156
  "semver": "~7.7.1",
157
- "tailwindcss-patch": "~7.0.0",
157
+ "tailwindcss-patch": "~7.0.2",
158
158
  "webpack-sources": "3.2.3",
159
159
  "@weapp-tailwindcss/init": "1.0.1",
160
- "@weapp-tailwindcss/mangle": "1.0.2",
161
160
  "@weapp-tailwindcss/logger": "1.0.0",
162
- "@weapp-tailwindcss/postcss": "1.0.5",
161
+ "@weapp-tailwindcss/mangle": "1.0.2",
162
+ "@weapp-tailwindcss/postcss": "1.0.6",
163
163
  "@weapp-tailwindcss/shared": "1.0.1"
164
164
  },
165
165
  "scripts": {
package/preflight.css CHANGED
@@ -7,8 +7,7 @@
7
7
  *,
8
8
  ::after,
9
9
  ::before,
10
- ::backdrop,
11
- ::file-selector-button {
10
+ ::backdrop {
12
11
  box-sizing: border-box; /* 1 */
13
12
  margin: 0; /* 2 */
14
13
  padding: 0; /* 2 */