weapp-tailwindcss 3.4.0 → 3.5.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.d.ts +2 -13
- package/dist/bundlers/gulp/index.d.ts +1 -2
- package/dist/bundlers/vite/index.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
- package/dist/cache/index.d.ts +0 -1
- package/dist/cli.js +11 -11
- package/dist/cli.mjs +11 -11
- package/dist/core.d.ts +3 -3
- package/dist/core.js +23 -30
- package/dist/core.mjs +22 -29
- package/dist/css-macro/index.d.ts +1 -1
- package/dist/gulp.js +13 -13
- package/dist/gulp.mjs +13 -13
- package/dist/{index-B5NiRecR.js → index-B8Pxc74h.js} +7 -7
- package/dist/{index-DwZHOkK3.js → index-CCbEWRGc.js} +3 -1
- package/dist/{index-B2TNoaOv.mjs → index-ClzClhjc.mjs} +4 -4
- package/dist/{index-DmzxhHCX.js → index-Ddev8wez.js} +4 -4
- package/dist/{index-DeW_zXzo.mjs → index-rwuSO4cM.mjs} +7 -7
- package/dist/{index-BPzIdybK.mjs → index-szMvMylQ.mjs} +3 -1
- package/dist/index.js +15 -15
- package/dist/index.mjs +15 -15
- package/dist/js/handlers.d.ts +1 -1
- package/dist/js/index.d.ts +1 -1
- package/dist/mangle/index.d.ts +2 -2
- package/dist/{options-7EjuAISl.mjs → options-BT2K7ro6.mjs} +190 -189
- package/dist/{options-C-rvBixk.js → options-BjD225Hm.js} +192 -191
- package/dist/postcss/index.d.ts +4 -3
- package/dist/postcss/mp.d.ts +1 -1
- package/dist/postcss/plugins/index.d.ts +1 -1
- package/dist/postcss/plugins/post.d.ts +1 -1
- package/dist/postcss/plugins/pre.d.ts +1 -1
- package/dist/postcss/preflight.d.ts +1 -1
- package/dist/postcss/selectorParser.d.ts +1 -1
- package/dist/postcss/shared.d.ts +1 -1
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/utils.d.ts +3 -3
- package/dist/{v5-Ch6783yy.js → v5-_VYyLdJC.js} +3 -3
- package/dist/{v5-BD9-sqra.mjs → v5-vdra_05U.mjs} +3 -3
- package/dist/vite.js +13 -13
- package/dist/vite.mjs +13 -13
- package/dist/webpack.js +13 -13
- package/dist/webpack.mjs +13 -13
- package/dist/webpack4.js +11 -11
- package/dist/webpack4.mjs +11 -11
- package/dist/wxml/shared.d.ts +1 -1
- package/dist/wxml/utils.d.ts +3 -3
- package/package.json +11 -12
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var MagicString = require('magic-string');
|
|
4
|
-
var replace = require('./replace.js');
|
|
5
|
-
var regex = require('@weapp-core/regex');
|
|
6
|
-
require('@weapp-core/escape');
|
|
7
|
-
var escape = require('@ast-core/escape');
|
|
8
4
|
var _babelGenerate = require('@babel/generator');
|
|
9
5
|
var _babelTraverse = require('@babel/traverse');
|
|
10
6
|
var parser = require('@babel/parser');
|
|
7
|
+
require('@weapp-core/escape');
|
|
8
|
+
var escape = require('@ast-core/escape');
|
|
11
9
|
var defaults = require('./defaults-DW-EahCC.js');
|
|
10
|
+
var replace = require('./replace.js');
|
|
11
|
+
var regex = require('@weapp-core/regex');
|
|
12
|
+
var shared = require('@tailwindcss-mangle/shared');
|
|
13
|
+
var lruCache = require('lru-cache');
|
|
14
|
+
var md5 = require('md5');
|
|
15
|
+
var postcss = require('postcss');
|
|
16
|
+
var index = require('./index-CCbEWRGc.js');
|
|
12
17
|
var t = require('@babel/types');
|
|
13
18
|
var htmlparser2 = require('htmlparser2');
|
|
14
|
-
var postcss = require('postcss');
|
|
15
|
-
var index = require('./index-DwZHOkK3.js');
|
|
16
19
|
var path = require('node:path');
|
|
17
20
|
var process = require('node:process');
|
|
18
21
|
var tailwindcssPatch = require('tailwindcss-patch');
|
|
19
|
-
var shared = require('@tailwindcss-mangle/shared');
|
|
20
|
-
var lruCache = require('lru-cache');
|
|
21
|
-
var md5 = require('md5');
|
|
22
22
|
|
|
23
23
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
24
24
|
|
|
@@ -43,11 +43,11 @@ function _interopNamespaceCompat(e) {
|
|
|
43
43
|
var MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
|
|
44
44
|
var _babelGenerate__default = /*#__PURE__*/_interopDefaultCompat(_babelGenerate);
|
|
45
45
|
var _babelTraverse__default = /*#__PURE__*/_interopDefaultCompat(_babelTraverse);
|
|
46
|
-
var
|
|
46
|
+
var md5__default = /*#__PURE__*/_interopDefaultCompat(md5);
|
|
47
47
|
var postcss__default = /*#__PURE__*/_interopDefaultCompat(postcss);
|
|
48
|
+
var t__namespace = /*#__PURE__*/_interopNamespaceCompat(t);
|
|
48
49
|
var path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
49
50
|
var process__default = /*#__PURE__*/_interopDefaultCompat(process);
|
|
50
|
-
var md5__default = /*#__PURE__*/_interopDefaultCompat(md5);
|
|
51
51
|
|
|
52
52
|
/******************************************************************************
|
|
53
53
|
Copyright (c) Microsoft Corporation.
|
|
@@ -81,6 +81,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
81
81
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
+
function _interopDefaultCompat$1(e) {
|
|
85
|
+
return e && typeof e === 'object' && 'default' in e ? e.default : e;
|
|
86
|
+
}
|
|
87
|
+
_interopDefaultCompat$1(_babelGenerate__default["default"]);
|
|
88
|
+
const traverse = _interopDefaultCompat$1(_babelTraverse__default["default"]);
|
|
89
|
+
|
|
84
90
|
function decodeUnicode2(input) {
|
|
85
91
|
try {
|
|
86
92
|
return JSON.parse(`"${input}"`);
|
|
@@ -137,12 +143,6 @@ function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
|
137
143
|
return rawStr;
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
function _interopDefaultCompat$1(e) {
|
|
141
|
-
return e && typeof e === 'object' && 'default' in e ? e.default : e;
|
|
142
|
-
}
|
|
143
|
-
_interopDefaultCompat$1(_babelGenerate__default["default"]);
|
|
144
|
-
const traverse = _interopDefaultCompat$1(_babelTraverse__default["default"]);
|
|
145
|
-
|
|
146
146
|
function isEvalPath(p) {
|
|
147
147
|
if (p.isCallExpression()) {
|
|
148
148
|
const calleePath = p.get('callee');
|
|
@@ -264,6 +264,9 @@ function jsHandler(rawSource, options) {
|
|
|
264
264
|
traverse(ast, traverseOptions);
|
|
265
265
|
return {
|
|
266
266
|
code: ms.toString(),
|
|
267
|
+
get map() {
|
|
268
|
+
return ms.generateMap();
|
|
269
|
+
},
|
|
267
270
|
};
|
|
268
271
|
}
|
|
269
272
|
function jsHandlerAsync(rawSource, options) {
|
|
@@ -321,6 +324,178 @@ function createJsHandler(options) {
|
|
|
321
324
|
return _jsHandler;
|
|
322
325
|
}
|
|
323
326
|
|
|
327
|
+
function getSelf(x) {
|
|
328
|
+
return x;
|
|
329
|
+
}
|
|
330
|
+
const defaultMangleContext = {
|
|
331
|
+
rawOptions: false,
|
|
332
|
+
runtimeSet: new Set(),
|
|
333
|
+
classGenerator: new shared.ClassGenerator(),
|
|
334
|
+
filter: shared.defaultMangleClassFilter,
|
|
335
|
+
cssHandler: getSelf,
|
|
336
|
+
jsHandler: getSelf,
|
|
337
|
+
wxmlHandler: getSelf,
|
|
338
|
+
};
|
|
339
|
+
function useMangleStore() {
|
|
340
|
+
const ctx = Object.assign({}, defaultMangleContext);
|
|
341
|
+
function resetMangle() {
|
|
342
|
+
return Object.assign(ctx, defaultMangleContext);
|
|
343
|
+
}
|
|
344
|
+
function handleValue(rawSource) {
|
|
345
|
+
const arr = splitCode(rawSource);
|
|
346
|
+
for (const x of arr) {
|
|
347
|
+
if (ctx.runtimeSet.has(x)) {
|
|
348
|
+
rawSource = rawSource.replace(new RegExp(regex.escapeStringRegexp(x)), ctx.classGenerator.generateClassName(x).name);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return rawSource;
|
|
352
|
+
}
|
|
353
|
+
function initMangle(options) {
|
|
354
|
+
var _a;
|
|
355
|
+
ctx.rawOptions = options;
|
|
356
|
+
if (options) {
|
|
357
|
+
if (options === true) {
|
|
358
|
+
options = {
|
|
359
|
+
classGenerator: {},
|
|
360
|
+
mangleClassFilter: shared.defaultMangleClassFilter,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
ctx.classGenerator = new shared.ClassGenerator(options.classGenerator);
|
|
364
|
+
ctx.filter = (_a = options.mangleClassFilter) !== null && _a !== void 0 ? _a : shared.defaultMangleClassFilter;
|
|
365
|
+
ctx.jsHandler = (rawSource) => {
|
|
366
|
+
return handleValue(rawSource);
|
|
367
|
+
};
|
|
368
|
+
ctx.cssHandler = (rawSource) => {
|
|
369
|
+
return handleValue(rawSource);
|
|
370
|
+
};
|
|
371
|
+
ctx.wxmlHandler = (rawSource) => {
|
|
372
|
+
return handleValue(rawSource);
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
function setMangleRuntimeSet(runtimeSet) {
|
|
377
|
+
const newSet = new Set();
|
|
378
|
+
for (const c of runtimeSet) {
|
|
379
|
+
if (ctx.filter(c)) {
|
|
380
|
+
newSet.add(c);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
ctx.runtimeSet = newSet;
|
|
384
|
+
}
|
|
385
|
+
return {
|
|
386
|
+
mangleContext: ctx,
|
|
387
|
+
resetMangle,
|
|
388
|
+
initMangle,
|
|
389
|
+
setMangleRuntimeSet,
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function createCache(options) {
|
|
394
|
+
const disabled = options === false;
|
|
395
|
+
const hashMap = new Map();
|
|
396
|
+
const instance = new lruCache.LRUCache({
|
|
397
|
+
max: 1024,
|
|
398
|
+
ttl: 0,
|
|
399
|
+
ttlAutopurge: false,
|
|
400
|
+
});
|
|
401
|
+
return {
|
|
402
|
+
hashMap,
|
|
403
|
+
instance,
|
|
404
|
+
hasHashKey(key) {
|
|
405
|
+
return hashMap.has(key);
|
|
406
|
+
},
|
|
407
|
+
getHashValue(key) {
|
|
408
|
+
return hashMap.get(key);
|
|
409
|
+
},
|
|
410
|
+
setHashValue(key, value) {
|
|
411
|
+
return hashMap.set(key, value);
|
|
412
|
+
},
|
|
413
|
+
get(key) {
|
|
414
|
+
return instance.get(key);
|
|
415
|
+
},
|
|
416
|
+
set(key, value) {
|
|
417
|
+
return instance.set(key, value);
|
|
418
|
+
},
|
|
419
|
+
computeHash(message) {
|
|
420
|
+
return md5__default["default"](message);
|
|
421
|
+
},
|
|
422
|
+
calcHashValueChanged(key, hash) {
|
|
423
|
+
const hit = this.getHashValue(key);
|
|
424
|
+
if (hit) {
|
|
425
|
+
this.setHashValue(key, {
|
|
426
|
+
changed: hash !== hit.hash,
|
|
427
|
+
hash,
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
this.setHashValue(key, {
|
|
432
|
+
changed: true,
|
|
433
|
+
hash,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
return this;
|
|
437
|
+
},
|
|
438
|
+
has(key) {
|
|
439
|
+
return instance.has(key);
|
|
440
|
+
},
|
|
441
|
+
process(key, callback, fallback) {
|
|
442
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
443
|
+
if (disabled) {
|
|
444
|
+
const res = yield fallback();
|
|
445
|
+
if (res) {
|
|
446
|
+
this.set(res.key, res.source);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
const hit = this.getHashValue(key);
|
|
451
|
+
if (hit && !hit.changed) {
|
|
452
|
+
const returnFlag = yield callback();
|
|
453
|
+
if (returnFlag !== false) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const res = yield fallback();
|
|
458
|
+
if (res) {
|
|
459
|
+
this.set(res.key, res.source);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
},
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function styleHandler(rawSource, options) {
|
|
468
|
+
var _a, _b;
|
|
469
|
+
return postcss__default["default"](index.getPlugins(options))
|
|
470
|
+
.process(rawSource, (_b = (_a = options.postcssOptions) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : {
|
|
471
|
+
from: undefined,
|
|
472
|
+
})
|
|
473
|
+
.async();
|
|
474
|
+
}
|
|
475
|
+
function createStyleHandler(options) {
|
|
476
|
+
return (rawSource, opt) => {
|
|
477
|
+
return styleHandler(rawSource, defaults.defuOverrideArray(opt, options));
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function createInjectPreflight(options) {
|
|
482
|
+
const result = [];
|
|
483
|
+
if (options && typeof options === 'object') {
|
|
484
|
+
const entries = Object.entries(options);
|
|
485
|
+
for (const [prop, value] of entries) {
|
|
486
|
+
if (value !== false) {
|
|
487
|
+
result.push({
|
|
488
|
+
prop,
|
|
489
|
+
value: value.toString(),
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return () => {
|
|
495
|
+
return result;
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
|
|
324
499
|
var State;
|
|
325
500
|
(function (State) {
|
|
326
501
|
State[State["START"] = 0] = "START";
|
|
@@ -647,40 +822,6 @@ function createTemplateHandler(options = {}) {
|
|
|
647
822
|
};
|
|
648
823
|
}
|
|
649
824
|
|
|
650
|
-
function styleHandler(rawSource, options) {
|
|
651
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
652
|
-
var _a, _b;
|
|
653
|
-
return (yield postcss__default["default"](index.getPlugins(options))
|
|
654
|
-
.process(rawSource, (_b = (_a = options.postcssOptions) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : {
|
|
655
|
-
from: undefined,
|
|
656
|
-
})
|
|
657
|
-
.async()).css;
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
function createStyleHandler(options) {
|
|
661
|
-
return (rawSource, opt) => {
|
|
662
|
-
return styleHandler(rawSource, defaults.defuOverrideArray(opt, options));
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
function createInjectPreflight(options) {
|
|
667
|
-
const result = [];
|
|
668
|
-
if (options && typeof options === 'object') {
|
|
669
|
-
const entries = Object.entries(options);
|
|
670
|
-
for (const [prop, value] of entries) {
|
|
671
|
-
if (value !== false) {
|
|
672
|
-
result.push({
|
|
673
|
-
prop,
|
|
674
|
-
value: value.toString(),
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
return () => {
|
|
680
|
-
return result;
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
|
|
684
825
|
function createTailwindcssPatcher(basedir, cacheDir, supportCustomLengthUnitsPatch) {
|
|
685
826
|
const cache = {};
|
|
686
827
|
if (cacheDir) {
|
|
@@ -706,146 +847,6 @@ function createTailwindcssPatcher(basedir, cacheDir, supportCustomLengthUnitsPat
|
|
|
706
847
|
});
|
|
707
848
|
}
|
|
708
849
|
|
|
709
|
-
function getSelf(x) {
|
|
710
|
-
return x;
|
|
711
|
-
}
|
|
712
|
-
const defaultMangleContext = {
|
|
713
|
-
rawOptions: false,
|
|
714
|
-
runtimeSet: new Set(),
|
|
715
|
-
classGenerator: new shared.ClassGenerator(),
|
|
716
|
-
filter: shared.defaultMangleClassFilter,
|
|
717
|
-
cssHandler: getSelf,
|
|
718
|
-
jsHandler: getSelf,
|
|
719
|
-
wxmlHandler: getSelf,
|
|
720
|
-
};
|
|
721
|
-
function useMangleStore() {
|
|
722
|
-
const ctx = Object.assign({}, defaultMangleContext);
|
|
723
|
-
function resetMangle() {
|
|
724
|
-
return Object.assign(ctx, defaultMangleContext);
|
|
725
|
-
}
|
|
726
|
-
function handleValue(rawSource) {
|
|
727
|
-
const arr = splitCode(rawSource);
|
|
728
|
-
for (const x of arr) {
|
|
729
|
-
if (ctx.runtimeSet.has(x)) {
|
|
730
|
-
rawSource = rawSource.replace(new RegExp(regex.escapeStringRegexp(x)), ctx.classGenerator.generateClassName(x).name);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
return rawSource;
|
|
734
|
-
}
|
|
735
|
-
function initMangle(options) {
|
|
736
|
-
var _a;
|
|
737
|
-
ctx.rawOptions = options;
|
|
738
|
-
if (options) {
|
|
739
|
-
if (options === true) {
|
|
740
|
-
options = {
|
|
741
|
-
classGenerator: {},
|
|
742
|
-
mangleClassFilter: shared.defaultMangleClassFilter,
|
|
743
|
-
};
|
|
744
|
-
}
|
|
745
|
-
ctx.classGenerator = new shared.ClassGenerator(options.classGenerator);
|
|
746
|
-
ctx.filter = (_a = options.mangleClassFilter) !== null && _a !== void 0 ? _a : shared.defaultMangleClassFilter;
|
|
747
|
-
ctx.jsHandler = (rawSource) => {
|
|
748
|
-
return handleValue(rawSource);
|
|
749
|
-
};
|
|
750
|
-
ctx.cssHandler = (rawSource) => {
|
|
751
|
-
return handleValue(rawSource);
|
|
752
|
-
};
|
|
753
|
-
ctx.wxmlHandler = (rawSource) => {
|
|
754
|
-
return handleValue(rawSource);
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
function setMangleRuntimeSet(runtimeSet) {
|
|
759
|
-
const newSet = new Set();
|
|
760
|
-
for (const c of runtimeSet) {
|
|
761
|
-
if (ctx.filter(c)) {
|
|
762
|
-
newSet.add(c);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
ctx.runtimeSet = newSet;
|
|
766
|
-
}
|
|
767
|
-
return {
|
|
768
|
-
mangleContext: ctx,
|
|
769
|
-
resetMangle,
|
|
770
|
-
initMangle,
|
|
771
|
-
setMangleRuntimeSet,
|
|
772
|
-
};
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
function createCache(options) {
|
|
776
|
-
const disabled = options === false;
|
|
777
|
-
const hashMap = new Map();
|
|
778
|
-
const instance = new lruCache.LRUCache({
|
|
779
|
-
max: 1024,
|
|
780
|
-
ttl: 0,
|
|
781
|
-
ttlAutopurge: false,
|
|
782
|
-
});
|
|
783
|
-
return {
|
|
784
|
-
hashMap,
|
|
785
|
-
instance,
|
|
786
|
-
hasHashKey(key) {
|
|
787
|
-
return hashMap.has(key);
|
|
788
|
-
},
|
|
789
|
-
getHashValue(key) {
|
|
790
|
-
return hashMap.get(key);
|
|
791
|
-
},
|
|
792
|
-
setHashValue(key, value) {
|
|
793
|
-
return hashMap.set(key, value);
|
|
794
|
-
},
|
|
795
|
-
get(key) {
|
|
796
|
-
return instance.get(key);
|
|
797
|
-
},
|
|
798
|
-
set(key, value) {
|
|
799
|
-
return instance.set(key, value);
|
|
800
|
-
},
|
|
801
|
-
computeHash(message) {
|
|
802
|
-
return md5__default["default"](message);
|
|
803
|
-
},
|
|
804
|
-
calcHashValueChanged(key, hash) {
|
|
805
|
-
const hit = this.getHashValue(key);
|
|
806
|
-
if (hit) {
|
|
807
|
-
this.setHashValue(key, {
|
|
808
|
-
changed: hash !== hit.hash,
|
|
809
|
-
hash,
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
else {
|
|
813
|
-
this.setHashValue(key, {
|
|
814
|
-
changed: true,
|
|
815
|
-
hash,
|
|
816
|
-
});
|
|
817
|
-
}
|
|
818
|
-
return this;
|
|
819
|
-
},
|
|
820
|
-
has(key) {
|
|
821
|
-
return instance.has(key);
|
|
822
|
-
},
|
|
823
|
-
process(key, callback, fallback) {
|
|
824
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
825
|
-
if (disabled) {
|
|
826
|
-
const res = yield fallback();
|
|
827
|
-
if (res) {
|
|
828
|
-
this.set(res.key, res.source);
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
else {
|
|
832
|
-
const hit = this.getHashValue(key);
|
|
833
|
-
if (hit && !hit.changed) {
|
|
834
|
-
const returnFlag = yield callback();
|
|
835
|
-
if (returnFlag !== false) {
|
|
836
|
-
return;
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
const res = yield fallback();
|
|
840
|
-
if (res) {
|
|
841
|
-
this.set(res.key, res.source);
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
});
|
|
845
|
-
},
|
|
846
|
-
};
|
|
847
|
-
}
|
|
848
|
-
|
|
849
850
|
function getOptions(opts) {
|
|
850
851
|
const result = defaults.defuOverrideArray(opts, defaults.defaultOptions, {});
|
|
851
852
|
result.escapeMap = result.customReplaceDictionary;
|
package/dist/postcss/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare function
|
|
1
|
+
import postcss from 'postcss';
|
|
2
|
+
import type { IStyleHandlerOptions } from '../types';
|
|
3
|
+
export declare function styleHandler(rawSource: string, options: IStyleHandlerOptions): Promise<postcss.Result<postcss.Document | postcss.Root>>;
|
|
4
|
+
export declare function createStyleHandler(options: Partial<IStyleHandlerOptions>): (rawSource: string, opt?: Partial<IStyleHandlerOptions>) => Promise<postcss.Result<postcss.Document | postcss.Root>>;
|
package/dist/postcss/mp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rule } from 'postcss';
|
|
2
|
-
import type { IStyleHandlerOptions } from
|
|
2
|
+
import type { IStyleHandlerOptions } from '../types';
|
|
3
3
|
export declare function testIfVariablesScope(node: Rule, count?: number): boolean;
|
|
4
4
|
export declare function testIfTwBackdrop(node: Rule, count?: number): boolean;
|
|
5
5
|
export declare function makePseudoVarRule(): Rule;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AcceptedPlugin } from 'postcss';
|
|
2
|
-
import type { IStyleHandlerOptions } from
|
|
2
|
+
import type { IStyleHandlerOptions } from '../../types';
|
|
3
3
|
export declare function getPlugins(options: IStyleHandlerOptions): AcceptedPlugin[];
|
|
4
4
|
export { postcssWeappTailwindcssPostPlugin } from './post';
|
|
5
5
|
export { postcssWeappTailwindcssPrePlugin } from './pre';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PluginCreator } from 'postcss';
|
|
2
|
-
import type { IStyleHandlerOptions } from
|
|
2
|
+
import type { IStyleHandlerOptions } from '../../types';
|
|
3
3
|
export type PostcssWeappTailwindcssRenamePlugin = PluginCreator<IStyleHandlerOptions>;
|
|
4
4
|
declare const postcssWeappTailwindcssPostPlugin: PostcssWeappTailwindcssRenamePlugin;
|
|
5
5
|
export { postcssWeappTailwindcssPostPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PluginCreator } from 'postcss';
|
|
2
|
-
import type { IStyleHandlerOptions } from
|
|
2
|
+
import type { IStyleHandlerOptions } from '../../types';
|
|
3
3
|
export type PostcssWeappTailwindcssRenamePlugin = PluginCreator<IStyleHandlerOptions>;
|
|
4
4
|
declare const postcssWeappTailwindcssPrePlugin: PostcssWeappTailwindcssRenamePlugin;
|
|
5
5
|
export { postcssWeappTailwindcssPrePlugin };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { CssPreflightOptions, IPropValue } from
|
|
1
|
+
import type { CssPreflightOptions, IPropValue } from '../types';
|
|
2
2
|
export type InjectPreflight = () => IPropValue[];
|
|
3
3
|
export declare function createInjectPreflight(options?: CssPreflightOptions): InjectPreflight;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import selectorParser from 'postcss-selector-parser';
|
|
2
2
|
import type { Rule } from 'postcss';
|
|
3
|
-
import type { IStyleHandlerOptions } from
|
|
3
|
+
import type { IStyleHandlerOptions } from '../types';
|
|
4
4
|
export declare function ruleTransformSync(rule: Rule, options: IStyleHandlerOptions): void;
|
|
5
5
|
export declare function isOnlyBeforeAndAfterPseudoElement(node: Rule): boolean;
|
|
6
6
|
export declare const fallbackRemove: selectorParser.Processor<void, selectorParser.Selectors>;
|
package/dist/postcss/shared.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { InternalCssSelectorReplacerOptions } from
|
|
1
|
+
import type { InternalCssSelectorReplacerOptions } from '../types';
|
|
2
2
|
export declare function internalCssSelectorReplacer(selectors: string, options?: InternalCssSelectorReplacerOptions): string;
|
|
3
3
|
export declare function composeIsPseudo(strs: string | string[]): string;
|
package/dist/postcss.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-CCbEWRGc.js');
|
|
6
6
|
var postcssIsPseudoClass = require('@csstools/postcss-is-pseudo-class');
|
|
7
7
|
var postcssRem2rpx = require('postcss-rem-to-responsive-pixel');
|
|
8
8
|
require('postcss-selector-parser');
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { g as getPlugins, p as postcssWeappTailwindcssPostPlugin, a as postcssWeappTailwindcssPrePlugin } from './index-
|
|
1
|
+
export { g as getPlugins, p as postcssWeappTailwindcssPostPlugin, a as postcssWeappTailwindcssPrePlugin } from './index-szMvMylQ.mjs';
|
|
2
2
|
export { default as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class';
|
|
3
3
|
export { default as postcssRem2rpx } from 'postcss-rem-to-responsive-pixel';
|
|
4
4
|
import 'postcss-selector-parser';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Rule } from 'postcss';
|
|
1
|
+
import type { Document, Result as PostcssResult, Root, Rule } from 'postcss';
|
|
2
2
|
import type { ClassGenerator, IClassGeneratorOptions } from '@tailwindcss-mangle/shared';
|
|
3
3
|
import type { SourceMap } from 'magic-string';
|
|
4
4
|
import type { GeneratorResult } from '@babel/generator';
|
|
@@ -8,7 +8,7 @@ import type { Result } from 'postcss-load-config';
|
|
|
8
8
|
import type { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
9
9
|
import type { InjectPreflight } from './postcss/preflight';
|
|
10
10
|
import type { IContext as PostcssContext } from './postcss/plugins/ctx';
|
|
11
|
-
import type { ICreateCacheReturnType } from
|
|
11
|
+
import type { ICreateCacheReturnType } from './cache';
|
|
12
12
|
type PostcssOptions = Partial<Omit<Result, 'file'>>;
|
|
13
13
|
export type ItemOrItemArray<T> = T | T[];
|
|
14
14
|
export type AppType = 'uni-app' | 'uni-app-vite' | 'taro' | 'remax' | 'rax' | 'native' | 'kbone' | 'mpx';
|
|
@@ -21,7 +21,7 @@ export type CssPreflightOptions = {
|
|
|
21
21
|
[key: CssPresetProps]: string | number | boolean;
|
|
22
22
|
} | false;
|
|
23
23
|
export type RequiredStyleHandlerOptions = {
|
|
24
|
-
isMainChunk
|
|
24
|
+
isMainChunk?: boolean;
|
|
25
25
|
cssInjectPreflight?: InjectPreflight;
|
|
26
26
|
escapeMap?: Record<string, string>;
|
|
27
27
|
} & Pick<UserDefinedOptions, 'cssPreflightRange' | 'cssChildCombinatorReplaceValue' | 'injectAdditionalCssVarScope' | 'cssSelectorReplacement' | 'rem2rpx'>;
|
|
@@ -141,7 +141,7 @@ export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
|
141
141
|
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary' | 'cache'> & {
|
|
142
142
|
supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | boolean;
|
|
143
143
|
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
144
|
-
styleHandler: (rawSource: string, options
|
|
144
|
+
styleHandler: (rawSource: string, options?: IStyleHandlerOptions) => Promise<PostcssResult<Root | Document>>;
|
|
145
145
|
jsHandler: JsHandler;
|
|
146
146
|
escapeMap: Record<string, string>;
|
|
147
147
|
patch: () => void;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InternalUserDefinedOptions } from
|
|
1
|
+
import type { InternalUserDefinedOptions } from './types';
|
|
2
2
|
export declare function isRegexp(value: unknown): boolean;
|
|
3
3
|
export declare function isMap(value: unknown): boolean;
|
|
4
4
|
export declare function regExpTest(arr: (string | RegExp)[] | undefined, str: string): boolean;
|
|
@@ -11,8 +11,8 @@ export declare const defuOverrideArray: <Source extends {
|
|
|
11
11
|
[x: string]: any;
|
|
12
12
|
[x: number]: any;
|
|
13
13
|
[x: symbol]: any;
|
|
14
|
-
}, Defaults extends
|
|
14
|
+
}, Defaults extends Array<{
|
|
15
15
|
[x: string]: any;
|
|
16
16
|
[x: number]: any;
|
|
17
17
|
[x: symbol]: any;
|
|
18
|
-
} | (number | boolean | any[] | Record<never, any> | null | undefined)
|
|
18
|
+
} | (number | boolean | any[] | Record<never, any> | null | undefined)>>(source: Source, ...defaults: Defaults) => import("defu").Defu<Source, Defaults>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-BjD225Hm.js');
|
|
4
4
|
var path = require('node:path');
|
|
5
5
|
var fs = require('node:fs');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-CCbEWRGc.js');
|
|
7
7
|
var defaults = require('./defaults-DW-EahCC.js');
|
|
8
8
|
var index$1 = require('./index-HC-Qkn0i.js');
|
|
9
9
|
|
|
@@ -155,7 +155,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
155
155
|
return false;
|
|
156
156
|
}
|
|
157
157
|
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
const css = yield styleHandler(rawSource, {
|
|
158
|
+
const { css } = yield styleHandler(rawSource, {
|
|
159
159
|
isMainChunk: mainCssChunkMatcher(file, this.appType),
|
|
160
160
|
});
|
|
161
161
|
const source = new ConcatSource(css);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { g as getOptions, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, _ as __awaiter } from './options-BT2K7ro6.mjs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
-
import { b as pluginName } from './index-
|
|
4
|
+
import { b as pluginName } from './index-szMvMylQ.mjs';
|
|
5
5
|
import { g as getGroupedEntries, r as removeExt } from './defaults-w3rlKQwe.mjs';
|
|
6
6
|
import { c as createDebug } from './index-BEIjgKpF.mjs';
|
|
7
7
|
|
|
@@ -148,7 +148,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
148
148
|
return false;
|
|
149
149
|
}
|
|
150
150
|
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
const css = yield styleHandler(rawSource, {
|
|
151
|
+
const { css } = yield styleHandler(rawSource, {
|
|
152
152
|
isMainChunk: mainCssChunkMatcher(file, this.appType),
|
|
153
153
|
});
|
|
154
154
|
const source = new ConcatSource(css);
|
package/dist/vite.js
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('./options-
|
|
5
|
+
var index = require('./index-Ddev8wez.js');
|
|
6
|
+
require('./options-BjD225Hm.js');
|
|
7
7
|
require('magic-string');
|
|
8
|
-
require('./replace.js');
|
|
9
|
-
require('@weapp-core/escape');
|
|
10
|
-
require('@ast-core/escape');
|
|
11
|
-
require('./shared-hzYeE1wX.js');
|
|
12
|
-
require('@weapp-core/regex');
|
|
13
8
|
require('@babel/generator');
|
|
14
9
|
require('@babel/traverse');
|
|
15
10
|
require('@babel/parser');
|
|
11
|
+
require('@weapp-core/escape');
|
|
12
|
+
require('@ast-core/escape');
|
|
16
13
|
require('./defaults-DW-EahCC.js');
|
|
17
14
|
require('./defu-Cdz2PomB.js');
|
|
18
|
-
require('
|
|
19
|
-
require('
|
|
15
|
+
require('./replace.js');
|
|
16
|
+
require('./shared-hzYeE1wX.js');
|
|
17
|
+
require('@weapp-core/regex');
|
|
18
|
+
require('@tailwindcss-mangle/shared');
|
|
19
|
+
require('lru-cache');
|
|
20
|
+
require('md5');
|
|
20
21
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
22
|
+
require('./index-CCbEWRGc.js');
|
|
22
23
|
require('@csstools/postcss-is-pseudo-class');
|
|
23
24
|
require('postcss-rem-to-responsive-pixel');
|
|
24
25
|
require('postcss-selector-parser');
|
|
26
|
+
require('@babel/types');
|
|
27
|
+
require('htmlparser2');
|
|
25
28
|
require('node:path');
|
|
26
29
|
require('node:process');
|
|
27
30
|
require('tailwindcss-patch');
|
|
28
|
-
require('@tailwindcss-mangle/shared');
|
|
29
|
-
require('lru-cache');
|
|
30
|
-
require('md5');
|
|
31
31
|
require('./index-HC-Qkn0i.js');
|
|
32
32
|
require('debug');
|
|
33
33
|
|