weapp-tailwindcss 2.3.4 → 2.4.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.
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
- var shared = require('./shared-c2953d9d.js');
4
3
  var micromatch = require('micromatch');
4
+ var t = require('@babel/types');
5
5
  var generate = require('@babel/generator');
6
6
  var parser = require('@babel/parser');
7
7
  var traverse = require('@babel/traverse');
8
8
  var replace = require('./replace.js');
9
- var t = require('@babel/types');
9
+ var shared = require('./shared-823d1fc1.js');
10
10
  var postcss = require('postcss');
11
- var postcss$1 = require('./postcss-dc9eeafc.js');
11
+ var postcss$1 = require('./postcss-06f57f3f.js');
12
12
  var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
13
- var path = require('path');
14
- var fs = require('fs');
13
+ var path = require('node:path');
14
+ var fs = require('node:fs');
15
15
  var semver = require('semver');
16
16
  var tailwindcssPatch = require('tailwindcss-patch');
17
17
 
@@ -35,9 +35,9 @@ function _interopNamespaceCompat(e) {
35
35
  return Object.freeze(n);
36
36
  }
37
37
 
38
+ var t__namespace = /*#__PURE__*/_interopNamespaceCompat(t);
38
39
  var generate__default = /*#__PURE__*/_interopDefaultCompat(generate);
39
40
  var traverse__default = /*#__PURE__*/_interopDefaultCompat(traverse);
40
- var t__namespace = /*#__PURE__*/_interopNamespaceCompat(t);
41
41
  var postcss__default = /*#__PURE__*/_interopDefaultCompat(postcss);
42
42
  var postcssIsPseudoClass__default = /*#__PURE__*/_interopDefaultCompat(postcssIsPseudoClass);
43
43
  var path__default = /*#__PURE__*/_interopDefaultCompat(path);
@@ -85,6 +85,145 @@ function createDefu(merger) {
85
85
  }
86
86
  const defu = createDefu();
87
87
 
88
+ const isProd = () => process.env.NODE_ENV === 'production';
89
+
90
+ function handleValue(str, node, options) {
91
+ const set = options.classNameSet;
92
+ const escapeMap = options.escapeMap;
93
+ const arr = shared.splitCode(str);
94
+ let rawStr = str;
95
+ for (const v of arr) {
96
+ if (set.has(v)) {
97
+ let ignoreFlag = false;
98
+ if (Array.isArray(node.leadingComments)) {
99
+ ignoreFlag = node.leadingComments.findIndex((x) => x.value.includes('weapp-tw') && x.value.includes('ignore')) > -1;
100
+ }
101
+ if (!ignoreFlag) {
102
+ const { jsHandler } = shared.useStore();
103
+ rawStr = jsHandler(rawStr);
104
+ rawStr = rawStr.replaceAll(new RegExp(shared.escapeStringRegexp(v), 'g'), replace.replaceJs(v, {
105
+ escapeMap
106
+ }));
107
+ }
108
+ }
109
+ }
110
+ return rawStr;
111
+ }
112
+ function jsHandler(rawSource, options) {
113
+ var _a;
114
+ const ast = parser.parse(rawSource, {
115
+ sourceType: 'unambiguous'
116
+ });
117
+ const topt = {
118
+ StringLiteral: {
119
+ enter(p) {
120
+ const n = p.node;
121
+ n.value = handleValue(n.value, n, options);
122
+ }
123
+ },
124
+ TemplateElement: {
125
+ enter(p) {
126
+ const n = p.node;
127
+ n.value.raw = handleValue(n.value.raw, n, options);
128
+ }
129
+ },
130
+ CallExpression: {
131
+ enter(p) {
132
+ const n = p.node;
133
+ if (t__namespace.isIdentifier(n.callee) && n.callee.name === 'eval' && t__namespace.isStringLiteral(n.arguments[0])) {
134
+ const res = jsHandler(n.arguments[0].value, options);
135
+ if (res.code) {
136
+ n.arguments[0].value = res.code;
137
+ }
138
+ }
139
+ }
140
+ },
141
+ noScope: true
142
+ };
143
+ traverse__default["default"](ast, topt);
144
+ return generate__default["default"](ast, {
145
+ minified: (_a = options.minifiedJs) !== null && _a !== void 0 ? _a : isProd()
146
+ });
147
+ }
148
+ function createjsHandler(options) {
149
+ return (rawSource, set) => {
150
+ return jsHandler(rawSource, {
151
+ classNameSet: set,
152
+ minifiedJs: options.minifiedJs,
153
+ escapeMap: options.escapeMap
154
+ });
155
+ };
156
+ }
157
+
158
+ const defaultOptions = {
159
+ cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
160
+ htmlMatcher: (file) => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
161
+ jsMatcher: (file) => {
162
+ if (file.includes('node_modules')) {
163
+ return false;
164
+ }
165
+ return /.+\.[cm]?js?$/.test(file);
166
+ },
167
+ mainCssChunkMatcher: (file, appType) => {
168
+ switch (appType) {
169
+ case 'uni-app': {
170
+ return /^common\/main/.test(file);
171
+ }
172
+ case 'uni-app-vite': {
173
+ return file.startsWith('app') || /^common\/main/.test(file);
174
+ }
175
+ case 'mpx': {
176
+ return file.startsWith('app');
177
+ }
178
+ case 'taro': {
179
+ return file.startsWith('app');
180
+ }
181
+ case 'remax': {
182
+ return file.startsWith('app');
183
+ }
184
+ case 'rax': {
185
+ return file.startsWith('bundle');
186
+ }
187
+ case 'native': {
188
+ return file.startsWith('app');
189
+ }
190
+ case 'kbone': {
191
+ return /^(?:common\/)?miniprogram-app/.test(file);
192
+ }
193
+ default: {
194
+ return true;
195
+ }
196
+ }
197
+ },
198
+ cssPreflight: {
199
+ 'box-sizing': 'border-box',
200
+ 'border-width': '0',
201
+ 'border-style': 'solid',
202
+ 'border-color': 'currentColor'
203
+ },
204
+ cssPreflightRange: 'view',
205
+ replaceUniversalSelectorWith: 'view',
206
+ disabled: false,
207
+ customRuleCallback: shared.noop,
208
+ onLoad: shared.noop,
209
+ onStart: shared.noop,
210
+ onEnd: shared.noop,
211
+ onUpdate: shared.noop,
212
+ customAttributes: {},
213
+ customReplaceDictionary: shared.SimpleMappingChars2String,
214
+ supportCustomLengthUnitsPatch: {
215
+ units: ['rpx'],
216
+ dangerousOptions: {
217
+ gteVersion: '3.0.0',
218
+ lengthUnitsFilePath: 'lib/util/dataTypes.js',
219
+ packageName: 'tailwindcss',
220
+ variableName: 'lengthUnits',
221
+ overwrite: true
222
+ }
223
+ },
224
+ appType: undefined
225
+ };
226
+
88
227
  function generateCode(match, options = {}) {
89
228
  const ast = parser.parseExpression(match);
90
229
  traverse__default["default"](ast, {
@@ -93,10 +232,8 @@ function generateCode(match, options = {}) {
93
232
  if (t__namespace.isMemberExpression(path.parent)) {
94
233
  return;
95
234
  }
96
- if (t__namespace.isBinaryExpression(path.parent)) {
97
- if (t__namespace.isConditionalExpression((_a = path.parentPath) === null || _a === void 0 ? void 0 : _a.parent)) {
98
- return;
99
- }
235
+ if (t__namespace.isBinaryExpression(path.parent) && t__namespace.isConditionalExpression((_a = path.parentPath) === null || _a === void 0 ? void 0 : _a.parent)) {
236
+ return;
100
237
  }
101
238
  path.node.value = replace.replaceJs(path.node.value, options);
102
239
  },
@@ -131,7 +268,7 @@ function extractSource(original) {
131
268
  }
132
269
  function templeteReplacer(original, options = {}) {
133
270
  const sources = extractSource(original);
134
- if (sources.length) {
271
+ if (sources.length > 0) {
135
272
  const resultArray = [];
136
273
  let p = 0;
137
274
  for (let i = 0; i < sources.length; i++) {
@@ -142,7 +279,7 @@ function templeteReplacer(original, options = {}) {
142
279
  escapeMap: options.escapeMap
143
280
  }));
144
281
  p = m.start;
145
- if (m.raw.trim().length) {
282
+ if (m.raw.trim().length > 0) {
146
283
  const code = generateCode(m.raw, options);
147
284
  const source = `{{${code}}}`;
148
285
  m.source = source;
@@ -161,7 +298,7 @@ function templeteReplacer(original, options = {}) {
161
298
  }
162
299
  }
163
300
  return resultArray
164
- .filter((x) => x)
301
+ .filter(Boolean)
165
302
  .join('')
166
303
  .trim();
167
304
  }
@@ -184,8 +321,7 @@ function customTempleteHandler(rawSource, options = {}) {
184
321
  const regexps = shared.makeCustomAttributes(options.customAttributesEntities);
185
322
  if (regexps) {
186
323
  if (Array.isArray(regexps)) {
187
- for (let i = 0; i < regexps.length; i++) {
188
- const regexp = regexps[i];
324
+ for (const regexp of regexps) {
189
325
  source = source.replace(regexp.tagRegexp, (m0) => {
190
326
  return m0.replace(regexp.attrRegexp, (m1, className) => {
191
327
  return m1.replace(className, templeteReplacer(className, options));
@@ -218,8 +354,7 @@ const createInjectPreflight = (options) => {
218
354
  const result = [];
219
355
  if (options && typeof options === 'object') {
220
356
  const entries = Object.entries(options);
221
- for (let i = 0; i < entries.length; i++) {
222
- const [prop, value] = entries[i];
357
+ for (const [prop, value] of entries) {
223
358
  if (value !== false) {
224
359
  result.push({
225
360
  prop,
@@ -240,30 +375,26 @@ function findAstNode(content, options) {
240
375
  let changed = false;
241
376
  traverse__default["default"](ast, {
242
377
  Identifier(path) {
243
- if (path.node.name === DOPTS.variableName) {
244
- if (t__namespace.isVariableDeclarator(path.parent)) {
245
- if (t__namespace.isArrayExpression(path.parent.init)) {
246
- arrayRef = path.parent.init;
247
- const set = new Set(path.parent.init.elements.map((x) => x.value));
248
- for (let i = 0; i < options.units.length; i++) {
249
- const unit = options.units[i];
250
- if (!set.has(unit)) {
251
- path.parent.init.elements = path.parent.init.elements.map((x) => {
252
- if (t__namespace.isStringLiteral(x)) {
253
- return {
254
- type: x === null || x === void 0 ? void 0 : x.type,
255
- value: x === null || x === void 0 ? void 0 : x.value
256
- };
257
- }
258
- return x;
259
- });
260
- path.parent.init.elements.push({
261
- type: 'StringLiteral',
262
- value: unit
263
- });
264
- changed = true;
378
+ if (path.node.name === DOPTS.variableName && t__namespace.isVariableDeclarator(path.parent) && t__namespace.isArrayExpression(path.parent.init)) {
379
+ arrayRef = path.parent.init;
380
+ const set = new Set(path.parent.init.elements.map((x) => x.value));
381
+ for (let i = 0; i < options.units.length; i++) {
382
+ const unit = options.units[i];
383
+ if (!set.has(unit)) {
384
+ path.parent.init.elements = path.parent.init.elements.map((x) => {
385
+ if (t__namespace.isStringLiteral(x)) {
386
+ return {
387
+ type: x === null || x === void 0 ? void 0 : x.type,
388
+ value: x === null || x === void 0 ? void 0 : x.value
389
+ };
265
390
  }
266
- }
391
+ return x;
392
+ });
393
+ path.parent.init.elements.push({
394
+ type: 'StringLiteral',
395
+ value: unit
396
+ });
397
+ changed = true;
267
398
  }
268
399
  }
269
400
  }
@@ -309,7 +440,7 @@ function monkeyPatchForSupportingCustomUnit(rootDir, options) {
309
440
  const DOPTS = dangerousOptions;
310
441
  const dataTypesFilePath = path__default["default"].resolve(rootDir, DOPTS.lengthUnitsFilePath);
311
442
  const dataTypesFileContent = fs__default["default"].readFileSync(dataTypesFilePath, {
312
- encoding: 'utf-8'
443
+ encoding: 'utf8'
313
444
  });
314
445
  const { arrayRef, changed } = findAstNode(dataTypesFileContent, options);
315
446
  if (arrayRef && changed) {
@@ -324,7 +455,7 @@ function monkeyPatchForSupportingCustomUnit(rootDir, options) {
324
455
  const newCode = prev + code + next;
325
456
  if (DOPTS.overwrite) {
326
457
  fs__default["default"].writeFileSync((_a = DOPTS.destPath) !== null && _a !== void 0 ? _a : dataTypesFilePath, newCode, {
327
- encoding: 'utf-8'
458
+ encoding: 'utf8'
328
459
  });
329
460
  console.log('patch tailwindcss for custom length unit successfully!');
330
461
  }
@@ -352,148 +483,6 @@ function createTailwindcssPatcher() {
352
483
  });
353
484
  }
354
485
 
355
- const isProd = () => process.env.NODE_ENV === 'production';
356
-
357
- function handleValue(str, node, options) {
358
- const set = options.classNameSet;
359
- const escapeMap = options.escapeMap;
360
- const arr = shared.splitCode(str);
361
- let rawStr = str;
362
- for (let i = 0; i < arr.length; i++) {
363
- const v = arr[i];
364
- if (set.has(v)) {
365
- let ignoreFlag = false;
366
- if (Array.isArray(node.leadingComments)) {
367
- ignoreFlag = node.leadingComments.findIndex((x) => x.value.includes('weapp-tw') && x.value.includes('ignore')) > -1;
368
- }
369
- if (!ignoreFlag) {
370
- const { jsHandler } = shared.useStore();
371
- rawStr = jsHandler(rawStr);
372
- rawStr = rawStr.replace(new RegExp(shared.escapeStringRegexp(v), 'g'), replace.replaceJs(v, {
373
- escapeMap
374
- }));
375
- }
376
- }
377
- }
378
- return rawStr;
379
- }
380
- function jsHandler(rawSource, options) {
381
- var _a;
382
- const ast = parser.parse(rawSource, {
383
- sourceType: 'unambiguous'
384
- });
385
- const topt = {
386
- StringLiteral: {
387
- enter(p) {
388
- const n = p.node;
389
- n.value = handleValue(n.value, n, options);
390
- }
391
- },
392
- TemplateElement: {
393
- enter(p) {
394
- const n = p.node;
395
- n.value.raw = handleValue(n.value.raw, n, options);
396
- }
397
- },
398
- CallExpression: {
399
- enter(p) {
400
- const n = p.node;
401
- if (t__namespace.isIdentifier(n.callee) && n.callee.name === 'eval') {
402
- if (t__namespace.isStringLiteral(n.arguments[0])) {
403
- const res = jsHandler(n.arguments[0].value, options);
404
- if (res.code) {
405
- n.arguments[0].value = res.code;
406
- }
407
- }
408
- }
409
- }
410
- },
411
- noScope: true
412
- };
413
- traverse__default["default"](ast, topt);
414
- return generate__default["default"](ast, {
415
- minified: (_a = options.minifiedJs) !== null && _a !== void 0 ? _a : isProd()
416
- });
417
- }
418
- function createjsHandler(options) {
419
- return (rawSource, set) => {
420
- return jsHandler(rawSource, {
421
- classNameSet: set,
422
- minifiedJs: options.minifiedJs,
423
- escapeMap: options.escapeMap
424
- });
425
- };
426
- }
427
-
428
- const defaultOptions = {
429
- cssMatcher: (file) => /.+\.(?:wx|ac|jx|tt|q|c)ss$/.test(file),
430
- htmlMatcher: (file) => /.+\.(?:(?:(?:wx|ax|jx|ks|tt|q)ml)|swan)$/.test(file),
431
- jsMatcher: (file) => {
432
- if (file.includes('node_modules')) {
433
- return false;
434
- }
435
- return /.+\.[cm]?[j]s?$/.test(file);
436
- },
437
- mainCssChunkMatcher: (file, appType) => {
438
- switch (appType) {
439
- case 'uni-app': {
440
- return /^common\/main/.test(file);
441
- }
442
- case 'uni-app-vite': {
443
- return /^app/.test(file) || /^common\/main/.test(file);
444
- }
445
- case 'mpx': {
446
- return /^app/.test(file);
447
- }
448
- case 'taro': {
449
- return /^app/.test(file);
450
- }
451
- case 'remax': {
452
- return /^app/.test(file);
453
- }
454
- case 'rax': {
455
- return /^bundle/.test(file);
456
- }
457
- case 'native': {
458
- return /^app/.test(file);
459
- }
460
- case 'kbone': {
461
- return /^(?:common\/)?miniprogram-app/.test(file);
462
- }
463
- default: {
464
- return true;
465
- }
466
- }
467
- },
468
- cssPreflight: {
469
- 'box-sizing': 'border-box',
470
- 'border-width': '0',
471
- 'border-style': 'solid',
472
- 'border-color': 'currentColor'
473
- },
474
- cssPreflightRange: 'view',
475
- replaceUniversalSelectorWith: 'view',
476
- disabled: false,
477
- customRuleCallback: shared.noop,
478
- onLoad: shared.noop,
479
- onStart: shared.noop,
480
- onEnd: shared.noop,
481
- onUpdate: shared.noop,
482
- customAttributes: {},
483
- customReplaceDictionary: shared.SimpleMappingChars2String,
484
- supportCustomLengthUnitsPatch: {
485
- units: ['rpx'],
486
- dangerousOptions: {
487
- gteVersion: '3.0.0',
488
- lengthUnitsFilePath: 'lib/util/dataTypes.js',
489
- packageName: 'tailwindcss',
490
- variableName: 'lengthUnits',
491
- overwrite: true
492
- }
493
- },
494
- appType: undefined
495
- };
496
-
497
486
  function createGlobMatcher(pattern) {
498
487
  return function (file) {
499
488
  return micromatch.isMatch(file, pattern);
@@ -535,17 +524,12 @@ function getOptions(options = {}, modules = ['style', 'templete', 'patch', 'js']
535
524
  const { cssPreflight, customRuleCallback, cssPreflightRange, replaceUniversalSelectorWith, customAttributes, customReplaceDictionary, supportCustomLengthUnitsPatch } = result;
536
525
  result.escapeMap = customReplaceDictionary;
537
526
  const cssInjectPreflight = createInjectPreflight(cssPreflight);
538
- let customAttributesEntities;
539
- if (shared.isMap(options.customAttributes)) {
540
- customAttributesEntities = Array.from(options.customAttributes.entries());
541
- }
542
- else {
543
- customAttributesEntities = Object.entries(customAttributes);
544
- }
527
+ const customAttributesEntities = shared.isMap(options.customAttributes) ? [...options.customAttributes.entries()] : Object.entries(customAttributes);
528
+ const { escapeMap, minifiedJs } = result;
545
529
  if (registerModules.templete) {
546
530
  result.templeteHandler = createTempleteHandler({
547
531
  customAttributesEntities,
548
- escapeMap: result.escapeMap
532
+ escapeMap
549
533
  });
550
534
  }
551
535
  if (registerModules.style) {
@@ -554,13 +538,13 @@ function getOptions(options = {}, modules = ['style', 'templete', 'patch', 'js']
554
538
  customRuleCallback,
555
539
  cssPreflightRange,
556
540
  replaceUniversalSelectorWith,
557
- escapeMap: result.escapeMap
541
+ escapeMap
558
542
  });
559
543
  }
560
544
  if (registerModules.js) {
561
545
  result.jsHandler = createjsHandler({
562
- minifiedJs: result.minifiedJs,
563
- escapeMap: result.escapeMap
546
+ minifiedJs,
547
+ escapeMap
564
548
  });
565
549
  }
566
550
  if (registerModules.patch) {
@@ -1,6 +1,6 @@
1
1
  import type { PluginCreator } from 'postcss';
2
2
  import type { IStyleHandlerOptions } from "../types";
3
- import postcssIsPseudoClass from '@csstools/postcss-is-pseudo-class';
4
3
  export type PostcssWeappTailwindcssRenamePlugin = PluginCreator<IStyleHandlerOptions>;
5
4
  declare const postcssWeappTailwindcss: PostcssWeappTailwindcssRenamePlugin;
6
- export { postcssWeappTailwindcss, postcssIsPseudoClass };
5
+ export { postcssWeappTailwindcss, };
6
+ export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var selectorParser = require('postcss-selector-parser');
4
- var shared = require('./shared-c2953d9d.js');
4
+ var shared = require('./shared-823d1fc1.js');
5
5
  var postcss = require('postcss');
6
6
  require('@csstools/postcss-is-pseudo-class');
7
7
 
@@ -59,16 +59,15 @@ function testIfVariablesScope(node, count = 1) {
59
59
  return false;
60
60
  }
61
61
  function commonChunkPreflight(node, options) {
62
- node.selector = node.selector.replace(BROAD_MATCH_GLOBAL_REGEXP, 'view + view');
62
+ node.selector = node.selector.replaceAll(BROAD_MATCH_GLOBAL_REGEXP, 'view + view');
63
63
  if (testIfVariablesScope(node)) {
64
64
  const selectorParts = node.selector.split(',');
65
65
  if (!selectorParts.includes('view')) {
66
66
  selectorParts.push('view');
67
67
  }
68
- if (options.cssPreflightRange === 'all') {
69
- if (!selectorParts.includes(':not(not)')) {
70
- selectorParts.push(':not(not)');
71
- }
68
+ if (options.cssPreflightRange === 'all' &&
69
+ !selectorParts.includes(':not(not)')) {
70
+ selectorParts.push(':not(not)');
72
71
  }
73
72
  node.selector = selectorParts.join(',');
74
73
  if (typeof options.cssInjectPreflight === 'function') {
@@ -1,5 +1,5 @@
1
1
  import selectorParser from 'postcss-selector-parser';
2
- import { f as internalCssSelectorReplacer } from './shared-eae1dc7a.mjs';
2
+ import { f as internalCssSelectorReplacer } from './shared-497eda3c.mjs';
3
3
  import { Rule, Declaration } from 'postcss';
4
4
  import '@csstools/postcss-is-pseudo-class';
5
5
 
@@ -53,16 +53,15 @@ function testIfVariablesScope(node, count = 1) {
53
53
  return false;
54
54
  }
55
55
  function commonChunkPreflight(node, options) {
56
- node.selector = node.selector.replace(BROAD_MATCH_GLOBAL_REGEXP, 'view + view');
56
+ node.selector = node.selector.replaceAll(BROAD_MATCH_GLOBAL_REGEXP, 'view + view');
57
57
  if (testIfVariablesScope(node)) {
58
58
  const selectorParts = node.selector.split(',');
59
59
  if (!selectorParts.includes('view')) {
60
60
  selectorParts.push('view');
61
61
  }
62
- if (options.cssPreflightRange === 'all') {
63
- if (!selectorParts.includes(':not(not)')) {
64
- selectorParts.push(':not(not)');
65
- }
62
+ if (options.cssPreflightRange === 'all' &&
63
+ !selectorParts.includes(':not(not)')) {
64
+ selectorParts.push(':not(not)');
66
65
  }
67
66
  node.selector = selectorParts.join(',');
68
67
  if (typeof options.cssInjectPreflight === 'function') {
package/dist/postcss.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var postcss = require('./postcss-dc9eeafc.js');
5
+ var postcss = require('./postcss-06f57f3f.js');
6
6
  var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
7
7
  require('postcss-selector-parser');
8
- require('./shared-c2953d9d.js');
8
+ require('./shared-823d1fc1.js');
9
9
  require('tailwindcss-mangle-shared');
10
10
  require('postcss');
11
11
 
package/dist/postcss.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { p as postcssWeappTailwindcss } from './postcss-1f9a5153.mjs';
1
+ export { p as postcssWeappTailwindcss } from './postcss-564aef44.mjs';
2
2
  export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
3
3
  import 'postcss-selector-parser';
4
- import './shared-eae1dc7a.mjs';
4
+ import './shared-497eda3c.mjs';
5
5
  import 'tailwindcss-mangle-shared';
6
6
  import 'postcss';
package/dist/replace.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { replaceWxml as replaceJs } from './wxml/shared';
2
- import { internalCssSelectorReplacer as replaceCss } from './postcss/shared';
3
1
  export * from './dic';
4
- export { replaceJs, replaceCss };
2
+ export { replaceWxml as replaceJs } from './wxml/shared';
3
+ export { internalCssSelectorReplacer as replaceCss } from './postcss/shared';
package/dist/replace.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var shared = require('./shared-c2953d9d.js');
5
+ var shared = require('./shared-823d1fc1.js');
6
6
  require('tailwindcss-mangle-shared');
7
7
 
8
8
  function replaceWxml(original, options = {
@@ -17,7 +17,7 @@ function replaceWxml(original, options = {
17
17
  let res = original;
18
18
  if (!options.keepEOL) {
19
19
  res = res
20
- .replace(/[\r\n]+/g, '');
20
+ .replaceAll(/[\n\r]+/g, '');
21
21
  }
22
22
  const { wxmlHandler } = shared.useStore();
23
23
  res = wxmlHandler(res);
package/dist/replace.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { h as escape, S as SimpleMappingChars2String, u as useStore } from './shared-eae1dc7a.mjs';
2
- export { M as MappingChars2String, k as MappingChars2StringEntries, j as SYMBOL_TABLE, l as SimpleMappingChars2StringEntries, f as replaceCss } from './shared-eae1dc7a.mjs';
1
+ import { h as escape, S as SimpleMappingChars2String, u as useStore } from './shared-497eda3c.mjs';
2
+ export { M as MappingChars2String, k as MappingChars2StringEntries, j as SYMBOL_TABLE, l as SimpleMappingChars2StringEntries, f as replaceCss } from './shared-497eda3c.mjs';
3
3
  import 'tailwindcss-mangle-shared';
4
4
 
5
5
  function replaceWxml(original, options = {
@@ -14,7 +14,7 @@ function replaceWxml(original, options = {
14
14
  let res = original;
15
15
  if (!options.keepEOL) {
16
16
  res = res
17
- .replace(/[\r\n]+/g, '');
17
+ .replaceAll(/[\n\r]+/g, '');
18
18
  }
19
19
  const { wxmlHandler } = useStore();
20
20
  res = wxmlHandler(res);