weapp-tailwindcss 3.0.10 → 3.1.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/cache/index.d.ts +2 -1
- package/dist/cli.js +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +13 -11
- package/dist/core.mjs +13 -11
- package/dist/css-macro/postcss.js +3 -3
- package/dist/css-macro/postcss.mjs +3 -3
- package/dist/gulp.js +5 -3
- package/dist/gulp.mjs +5 -3
- package/dist/{index-DfbtBzIV.mjs → index-BatBMY3C.mjs} +10 -10
- package/dist/index-C9cFs8_u.js +136 -0
- package/dist/{index-CKzzVDhq.js → index-CarwQa1I.js} +6 -2
- package/dist/{index-CLxBL7MC.mjs → index-CsZGfl55.mjs} +3 -2
- package/dist/index-DEWZ8_xX.mjs +130 -0
- package/dist/{index-C7QwtXvo.mjs → index-DKNUquoz.mjs} +6 -2
- package/dist/{index-CKXO21Qe.js → index-DyK5Vd4R.js} +3 -2
- package/dist/{index-BBGsdK79.js → index-jf-1m663.js} +10 -10
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -6
- package/dist/js/handlers.d.ts +9 -2
- package/dist/js/index.d.ts +2 -1
- package/dist/{options-Ce8c4jgF.js → options-AIjWBFPo.js} +154 -60
- package/dist/{options-D74YiXdv.mjs → options-D6Mza941.mjs} +154 -60
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/types.d.ts +7 -3
- package/dist/{v5-B5nztYEa.js → v5-BV64BMJS.js} +10 -10
- package/dist/{v5-KEbKT7UN.mjs → v5-CH-EIloz.mjs} +10 -10
- package/dist/vite.js +4 -4
- package/dist/vite.mjs +4 -4
- package/dist/webpack.js +4 -4
- package/dist/webpack.mjs +4 -4
- package/dist/webpack4.js +10 -10
- package/dist/webpack4.mjs +10 -10
- package/dist/wxml/utils.d.ts +2 -2
- package/package.json +41 -36
- package/dist/index-DMO3Y3vp.mjs +0 -64
- package/dist/index-DXyNWU95.js +0 -70
|
@@ -10,7 +10,7 @@ import { d as defuOverrideArray, n as noop, a as defaultOptions, i as isMap } fr
|
|
|
10
10
|
import * as t from '@babel/types';
|
|
11
11
|
import { Parser } from 'htmlparser2';
|
|
12
12
|
import postcss from 'postcss';
|
|
13
|
-
import { g as getPlugins } from './index-
|
|
13
|
+
import { g as getPlugins } from './index-DKNUquoz.mjs';
|
|
14
14
|
import path from 'node:path';
|
|
15
15
|
import fs from 'node:fs';
|
|
16
16
|
import { gte } from 'semver';
|
|
@@ -60,12 +60,23 @@ const splitCode = (code, allowDoubleQuotes = false) => {
|
|
|
60
60
|
return code.split(splitter).filter((element) => isValidSelector(element));
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
+
function decodeUnicode(s) {
|
|
64
|
+
return unescape(s.replaceAll(/\\(u[\dA-Fa-f]{4})/gm, '%$1'));
|
|
65
|
+
}
|
|
63
66
|
function replaceHandleValue(str, node, options, ms, offset = 0) {
|
|
64
|
-
const { classNameSet: set, escapeMap, mangleContext: ctx, needEscaped = false, jsPreserveClass, arbitraryValues, always } = options;
|
|
67
|
+
const { classNameSet: set, escapeMap, mangleContext: ctx, needEscaped = false, jsPreserveClass, arbitraryValues, always, unescapeUnicode } = options;
|
|
65
68
|
const allowDoubleQuotes = arbitraryValues === null || arbitraryValues === void 0 ? void 0 : arbitraryValues.allowDoubleQuotes;
|
|
66
69
|
const arr = splitCode(str, allowDoubleQuotes);
|
|
67
70
|
let rawStr = str;
|
|
68
|
-
|
|
71
|
+
let needDecodeUnicode = false;
|
|
72
|
+
if (unescapeUnicode && rawStr.includes('\\')) {
|
|
73
|
+
rawStr = decodeUnicode(rawStr);
|
|
74
|
+
needDecodeUnicode = true;
|
|
75
|
+
}
|
|
76
|
+
for (let v of arr) {
|
|
77
|
+
if (needDecodeUnicode && v.includes('\\')) {
|
|
78
|
+
v = decodeUnicode(v);
|
|
79
|
+
}
|
|
69
80
|
if (always || (set && set.has(v) && !(jsPreserveClass === null || jsPreserveClass === void 0 ? void 0 : jsPreserveClass(v)))) {
|
|
70
81
|
let ignoreFlag = false;
|
|
71
82
|
if (Array.isArray(node.leadingComments)) {
|
|
@@ -99,7 +110,46 @@ function isEvalPath(p) {
|
|
|
99
110
|
}
|
|
100
111
|
return false;
|
|
101
112
|
}
|
|
113
|
+
function getAstGrep() {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
try {
|
|
116
|
+
const { js } = yield import('@ast-grep/napi');
|
|
117
|
+
return js;
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
console.warn('请先安装 `@ast-grep/napi` , 安装完成后再尝试运行!');
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function astGrepUpdateString(ast, options, ms) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const js = yield getAstGrep();
|
|
128
|
+
const nodes = ast.findAll(js.kind('string'));
|
|
129
|
+
for (const node of nodes) {
|
|
130
|
+
const range = node.range();
|
|
131
|
+
const text = node.text();
|
|
132
|
+
replaceHandleValue(text.slice(1, -1), {
|
|
133
|
+
end: range.end.index - 1,
|
|
134
|
+
start: range.start.index + 1
|
|
135
|
+
}, Object.assign(Object.assign({}, options), { unescapeUnicode: true }), ms, 0);
|
|
136
|
+
}
|
|
137
|
+
const templateNodes = ast.findAll(js.kind('template_string'));
|
|
138
|
+
for (const node of templateNodes) {
|
|
139
|
+
const fragments = node.findAll(js.kind('string_fragment'));
|
|
140
|
+
for (const fragment of fragments) {
|
|
141
|
+
const range = fragment.range();
|
|
142
|
+
const text = fragment.text();
|
|
143
|
+
replaceHandleValue(text, {
|
|
144
|
+
end: range.end.index,
|
|
145
|
+
start: range.start.index
|
|
146
|
+
}, Object.assign(Object.assign({}, options), { unescapeUnicode: true }), ms, 0);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
102
151
|
function jsHandler(rawSource, options) {
|
|
152
|
+
const ms = new MagicString(rawSource);
|
|
103
153
|
let ast;
|
|
104
154
|
try {
|
|
105
155
|
ast = parse(rawSource, {
|
|
@@ -111,8 +161,7 @@ function jsHandler(rawSource, options) {
|
|
|
111
161
|
code: rawSource
|
|
112
162
|
};
|
|
113
163
|
}
|
|
114
|
-
const
|
|
115
|
-
const ropt = {
|
|
164
|
+
const traverseOptions = {
|
|
116
165
|
StringLiteral: {
|
|
117
166
|
enter(p) {
|
|
118
167
|
var _a;
|
|
@@ -173,14 +222,33 @@ function jsHandler(rawSource, options) {
|
|
|
173
222
|
}
|
|
174
223
|
}
|
|
175
224
|
};
|
|
176
|
-
traverse(ast,
|
|
177
|
-
|
|
225
|
+
traverse(ast, traverseOptions);
|
|
226
|
+
return {
|
|
178
227
|
code: ms.toString()
|
|
179
228
|
};
|
|
180
|
-
|
|
229
|
+
}
|
|
230
|
+
function jsHandlerAsync(rawSource, options) {
|
|
231
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
232
|
+
const ms = new MagicString(rawSource);
|
|
233
|
+
const js = yield getAstGrep();
|
|
234
|
+
let ast;
|
|
235
|
+
try {
|
|
236
|
+
const root = yield js.parseAsync(rawSource);
|
|
237
|
+
ast = root.root();
|
|
238
|
+
}
|
|
239
|
+
catch (_a) {
|
|
240
|
+
return {
|
|
241
|
+
code: rawSource
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
yield astGrepUpdateString(ast, options, ms);
|
|
245
|
+
return {
|
|
246
|
+
code: ms.toString()
|
|
247
|
+
};
|
|
248
|
+
});
|
|
181
249
|
}
|
|
182
250
|
function createJsHandler(options) {
|
|
183
|
-
const { mangleContext, arbitraryValues, escapeMap, jsPreserveClass, generateMap } = options;
|
|
251
|
+
const { mangleContext, arbitraryValues, escapeMap, jsPreserveClass, generateMap, jsAstTool } = options;
|
|
184
252
|
return (rawSource, set, options) => {
|
|
185
253
|
const opts = defuOverrideArray(options, {
|
|
186
254
|
classNameSet: set,
|
|
@@ -188,8 +256,12 @@ function createJsHandler(options) {
|
|
|
188
256
|
arbitraryValues,
|
|
189
257
|
mangleContext,
|
|
190
258
|
jsPreserveClass,
|
|
191
|
-
generateMap
|
|
259
|
+
generateMap,
|
|
260
|
+
jsAstTool
|
|
192
261
|
});
|
|
262
|
+
if (opts.jsAstTool === 'ast-grep') {
|
|
263
|
+
return jsHandlerAsync(rawSource, opts);
|
|
264
|
+
}
|
|
193
265
|
return jsHandler(rawSource, opts);
|
|
194
266
|
};
|
|
195
267
|
}
|
|
@@ -292,7 +364,7 @@ function regTest(reg, str) {
|
|
|
292
364
|
function isPropsMatch(props, attr) {
|
|
293
365
|
if (Array.isArray(props)) {
|
|
294
366
|
for (const prop of props) {
|
|
295
|
-
const res = typeof prop === 'string' ? prop.toLowerCase() === attr : regTest(prop, attr);
|
|
367
|
+
const res = typeof prop === 'string' ? prop.toLowerCase() === attr.toLowerCase() : regTest(prop, attr);
|
|
296
368
|
if (res) {
|
|
297
369
|
return res;
|
|
298
370
|
}
|
|
@@ -307,51 +379,63 @@ function isPropsMatch(props, attr) {
|
|
|
307
379
|
}
|
|
308
380
|
}
|
|
309
381
|
function customTemplateHandler(rawSource, options) {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
if (t === '*') {
|
|
327
|
-
if (isPropsMatch(props, name)) {
|
|
328
|
-
update();
|
|
329
|
-
}
|
|
382
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
383
|
+
const { customAttributesEntities = [], disabledDefaultTemplateHandler, inlineWxs, runtimeSet, jsHandler } = options !== null && options !== void 0 ? options : {};
|
|
384
|
+
const s = new MagicString(rawSource);
|
|
385
|
+
let tag = '';
|
|
386
|
+
const wxsArray = [];
|
|
387
|
+
const parser = new Parser({
|
|
388
|
+
onopentagname(name) {
|
|
389
|
+
tag = name;
|
|
390
|
+
},
|
|
391
|
+
onattribute(name, value, quote) {
|
|
392
|
+
if (value) {
|
|
393
|
+
function update() {
|
|
394
|
+
s.update(parser.startIndex + name.length + 2, parser.endIndex - 1, templateReplacer(value, Object.assign(Object.assign({}, options), { quote })));
|
|
395
|
+
}
|
|
396
|
+
if (!disabledDefaultTemplateHandler && (name === 'class' || name === 'hover-class' || name === 'virtualHostClass' || name === 'virtualhostclass')) {
|
|
397
|
+
update();
|
|
330
398
|
}
|
|
331
|
-
|
|
332
|
-
if (t ===
|
|
399
|
+
for (const [t, props] of customAttributesEntities) {
|
|
400
|
+
if (t === '*') {
|
|
401
|
+
if (isPropsMatch(props, name)) {
|
|
402
|
+
update();
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
else if (typeof t === 'string') {
|
|
406
|
+
if (t === tag && isPropsMatch(props, name)) {
|
|
407
|
+
update();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
else if (regTest(t, tag) && isPropsMatch(props, name)) {
|
|
333
411
|
update();
|
|
334
412
|
}
|
|
335
413
|
}
|
|
336
|
-
else if (regTest(t, tag) && isPropsMatch(props, name)) {
|
|
337
|
-
update();
|
|
338
|
-
}
|
|
339
414
|
}
|
|
415
|
+
},
|
|
416
|
+
ontext(data) {
|
|
417
|
+
if (inlineWxs && tag === 'wxs') {
|
|
418
|
+
wxsArray.push({
|
|
419
|
+
data,
|
|
420
|
+
endIndex: parser.endIndex + 1,
|
|
421
|
+
startIndex: parser.startIndex
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
onclosetag() {
|
|
426
|
+
tag = '';
|
|
340
427
|
}
|
|
341
|
-
},
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
tag = '';
|
|
428
|
+
}, {
|
|
429
|
+
xmlMode: true
|
|
430
|
+
});
|
|
431
|
+
parser.write(s.original);
|
|
432
|
+
parser.end();
|
|
433
|
+
for (const { data, endIndex, startIndex } of wxsArray) {
|
|
434
|
+
const { code } = yield jsHandler(data, runtimeSet);
|
|
435
|
+
s.update(startIndex, endIndex, code);
|
|
350
436
|
}
|
|
437
|
+
return s.toString();
|
|
351
438
|
});
|
|
352
|
-
parser.write(s.original);
|
|
353
|
-
parser.end();
|
|
354
|
-
return s.toString();
|
|
355
439
|
}
|
|
356
440
|
function createTemplateHandler(options = {}) {
|
|
357
441
|
return (rawSource, opt = {}) => {
|
|
@@ -571,7 +655,8 @@ function useMangleStore() {
|
|
|
571
655
|
};
|
|
572
656
|
}
|
|
573
657
|
|
|
574
|
-
function createCache() {
|
|
658
|
+
function createCache(options) {
|
|
659
|
+
const disabled = options === false;
|
|
575
660
|
const hashMap = new Map();
|
|
576
661
|
const instance = new LRUCache({
|
|
577
662
|
max: 1024,
|
|
@@ -620,16 +705,24 @@ function createCache() {
|
|
|
620
705
|
},
|
|
621
706
|
process(key, callback, fallback) {
|
|
622
707
|
return __awaiter(this, void 0, void 0, function* () {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
return;
|
|
708
|
+
if (disabled) {
|
|
709
|
+
const res = yield fallback();
|
|
710
|
+
if (res) {
|
|
711
|
+
this.set(res.key, res.source);
|
|
628
712
|
}
|
|
629
713
|
}
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
714
|
+
else {
|
|
715
|
+
const hit = this.getHashValue(key);
|
|
716
|
+
if (hit && !hit.changed) {
|
|
717
|
+
const returnFlag = yield callback();
|
|
718
|
+
if (returnFlag !== false) {
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
const res = yield fallback();
|
|
723
|
+
if (res) {
|
|
724
|
+
this.set(res.key, res.source);
|
|
725
|
+
}
|
|
633
726
|
}
|
|
634
727
|
});
|
|
635
728
|
}
|
|
@@ -641,7 +734,7 @@ function getOptions(options = {}) {
|
|
|
641
734
|
options.customReplaceDictionary = SimpleMappingChars2String;
|
|
642
735
|
}
|
|
643
736
|
const result = defuOverrideArray(options, defaultOptions, {});
|
|
644
|
-
const { cssPreflight, customRuleCallback, cssPreflightRange, customAttributes, customReplaceDictionary, supportCustomLengthUnitsPatch, arbitraryValues, cssChildCombinatorReplaceValue, inlineWxs, injectAdditionalCssVarScope, jsPreserveClass, disabledDefaultTemplateHandler, cssSelectorReplacement, rem2rpx } = result;
|
|
737
|
+
const { cssPreflight, customRuleCallback, cssPreflightRange, customAttributes, customReplaceDictionary, supportCustomLengthUnitsPatch, arbitraryValues, cssChildCombinatorReplaceValue, inlineWxs, injectAdditionalCssVarScope, jsPreserveClass, disabledDefaultTemplateHandler, cssSelectorReplacement, rem2rpx, cache, jsAstTool } = result;
|
|
645
738
|
result.escapeMap = customReplaceDictionary;
|
|
646
739
|
const cssInjectPreflight = createInjectPreflight(cssPreflight);
|
|
647
740
|
const customAttributesEntities = isMap(options.customAttributes)
|
|
@@ -667,7 +760,8 @@ function getOptions(options = {}) {
|
|
|
667
760
|
mangleContext,
|
|
668
761
|
arbitraryValues,
|
|
669
762
|
jsPreserveClass,
|
|
670
|
-
generateMap: true
|
|
763
|
+
generateMap: true,
|
|
764
|
+
jsAstTool
|
|
671
765
|
});
|
|
672
766
|
result.jsHandler = jsHandler;
|
|
673
767
|
const templateHandler = createTemplateHandler({
|
|
@@ -681,7 +775,7 @@ function getOptions(options = {}) {
|
|
|
681
775
|
result.templateHandler = templateHandler;
|
|
682
776
|
result.patch = createPatch(supportCustomLengthUnitsPatch);
|
|
683
777
|
result.setMangleRuntimeSet = setMangleRuntimeSet;
|
|
684
|
-
result.cache = createCache();
|
|
778
|
+
result.cache = cache === undefined || typeof cache === 'boolean' ? createCache(cache) : cache;
|
|
685
779
|
return result;
|
|
686
780
|
}
|
|
687
781
|
|
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-CarwQa1I.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-DKNUquoz.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
|
@@ -47,6 +47,8 @@ export type IJsHandlerOptions = {
|
|
|
47
47
|
needEscaped?: boolean;
|
|
48
48
|
generateMap?: boolean;
|
|
49
49
|
always?: boolean;
|
|
50
|
+
jsAstTool?: 'babel' | 'ast-grep';
|
|
51
|
+
unescapeUnicode?: boolean;
|
|
50
52
|
};
|
|
51
53
|
export interface RawSource {
|
|
52
54
|
start: number;
|
|
@@ -107,8 +109,10 @@ export interface UserDefinedOptions {
|
|
|
107
109
|
};
|
|
108
110
|
tailwindcssBasedir?: string;
|
|
109
111
|
rem2rpx?: boolean | rem2rpxOptions;
|
|
112
|
+
cache?: boolean | ICreateCacheReturnType;
|
|
113
|
+
jsAstTool?: 'babel' | 'ast-grep';
|
|
110
114
|
}
|
|
111
|
-
export type JsHandler = (rawSource: string, set: Set<string>, options?: CreateJsHandlerOptions) => JsHandlerResult
|
|
115
|
+
export type JsHandler = (rawSource: string, set: Set<string>, options?: CreateJsHandlerOptions) => JsHandlerResult | Promise<JsHandlerResult>;
|
|
112
116
|
export interface IMangleScopeContext {
|
|
113
117
|
rawOptions: UserDefinedOptions['mangle'];
|
|
114
118
|
runtimeSet: Set<string>;
|
|
@@ -132,9 +136,9 @@ export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
|
132
136
|
disabledDefaultTemplateHandler?: boolean;
|
|
133
137
|
quote?: string | null;
|
|
134
138
|
}
|
|
135
|
-
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary'> & {
|
|
139
|
+
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary' | 'cache'> & {
|
|
136
140
|
supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | false;
|
|
137
|
-
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => string
|
|
141
|
+
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
138
142
|
styleHandler: (rawSource: string, options: IStyleHandlerOptions) => Promise<string>;
|
|
139
143
|
jsHandler: JsHandler;
|
|
140
144
|
escapeMap: Record<string, string>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var options = require('./options-
|
|
3
|
+
var options = require('./options-AIjWBFPo.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-CarwQa1I.js');
|
|
7
7
|
var defaults = require('./defaults-BT3A8Rzc.js');
|
|
8
|
-
var index$1 = require('./index-
|
|
8
|
+
var index$1 = require('./index-DyK5Vd4R.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
11
|
|
|
12
12
|
var path__default = /*#__PURE__*/_interopDefaultCompat(path);
|
|
13
13
|
var fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
|
|
14
14
|
|
|
15
|
-
const debug = index$1.createDebug(
|
|
15
|
+
const debug = index$1.createDebug();
|
|
16
16
|
class UnifiedWebpackPluginV5 {
|
|
17
17
|
constructor(options$1 = {}) {
|
|
18
18
|
if (options$1.customReplaceDictionary === undefined) {
|
|
@@ -88,8 +88,8 @@ class UnifiedWebpackPluginV5 {
|
|
|
88
88
|
else {
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
|
-
}, () => {
|
|
92
|
-
const wxml = templateHandler(rawSource, {
|
|
91
|
+
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const wxml = yield templateHandler(rawSource, {
|
|
93
93
|
runtimeSet
|
|
94
94
|
});
|
|
95
95
|
const source = new ConcatSource(wxml);
|
|
@@ -101,7 +101,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
101
101
|
key: cacheKey,
|
|
102
102
|
source
|
|
103
103
|
};
|
|
104
|
-
});
|
|
104
|
+
}));
|
|
105
105
|
}
|
|
106
106
|
debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
|
|
107
107
|
}
|
|
@@ -119,11 +119,11 @@ class UnifiedWebpackPluginV5 {
|
|
|
119
119
|
else {
|
|
120
120
|
return false;
|
|
121
121
|
}
|
|
122
|
-
}, () => {
|
|
122
|
+
}, () => options.__awaiter(this, void 0, void 0, function* () {
|
|
123
123
|
const rawSource = originalSource.source().toString();
|
|
124
124
|
const mapFilename = file + '.map';
|
|
125
125
|
const hasMap = Boolean(assets[mapFilename]);
|
|
126
|
-
const { code, map } = jsHandler(rawSource, runtimeSet, {
|
|
126
|
+
const { code, map } = yield jsHandler(rawSource, runtimeSet, {
|
|
127
127
|
generateMap: hasMap
|
|
128
128
|
});
|
|
129
129
|
const source = new ConcatSource(code);
|
|
@@ -139,7 +139,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
139
139
|
key: cacheKey,
|
|
140
140
|
source
|
|
141
141
|
};
|
|
142
|
-
});
|
|
142
|
+
}));
|
|
143
143
|
}
|
|
144
144
|
debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
|
|
145
145
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-
|
|
1
|
+
import { g as getOptions, c as createTailwindcssPatcher, _ as __awaiter } from './options-D6Mza941.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-DKNUquoz.mjs';
|
|
5
5
|
import { g as getGroupedEntries, r as removeExt } from './defaults-CBb6_9nJ.mjs';
|
|
6
|
-
import { c as createDebug } from './index-
|
|
6
|
+
import { c as createDebug } from './index-CsZGfl55.mjs';
|
|
7
7
|
|
|
8
|
-
const debug = createDebug(
|
|
8
|
+
const debug = createDebug();
|
|
9
9
|
class UnifiedWebpackPluginV5 {
|
|
10
10
|
constructor(options = {}) {
|
|
11
11
|
if (options.customReplaceDictionary === undefined) {
|
|
@@ -81,8 +81,8 @@ class UnifiedWebpackPluginV5 {
|
|
|
81
81
|
else {
|
|
82
82
|
return false;
|
|
83
83
|
}
|
|
84
|
-
}, () => {
|
|
85
|
-
const wxml = templateHandler(rawSource, {
|
|
84
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const wxml = yield templateHandler(rawSource, {
|
|
86
86
|
runtimeSet
|
|
87
87
|
});
|
|
88
88
|
const source = new ConcatSource(wxml);
|
|
@@ -94,7 +94,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
94
94
|
key: cacheKey,
|
|
95
95
|
source
|
|
96
96
|
};
|
|
97
|
-
});
|
|
97
|
+
}));
|
|
98
98
|
}
|
|
99
99
|
debug('html handle finish, total: %d, no-cached: %d', groupedEntries.html.length, noCachedCount);
|
|
100
100
|
}
|
|
@@ -112,11 +112,11 @@ class UnifiedWebpackPluginV5 {
|
|
|
112
112
|
else {
|
|
113
113
|
return false;
|
|
114
114
|
}
|
|
115
|
-
}, () => {
|
|
115
|
+
}, () => __awaiter(this, void 0, void 0, function* () {
|
|
116
116
|
const rawSource = originalSource.source().toString();
|
|
117
117
|
const mapFilename = file + '.map';
|
|
118
118
|
const hasMap = Boolean(assets[mapFilename]);
|
|
119
|
-
const { code, map } = jsHandler(rawSource, runtimeSet, {
|
|
119
|
+
const { code, map } = yield jsHandler(rawSource, runtimeSet, {
|
|
120
120
|
generateMap: hasMap
|
|
121
121
|
});
|
|
122
122
|
const source = new ConcatSource(code);
|
|
@@ -132,7 +132,7 @@ class UnifiedWebpackPluginV5 {
|
|
|
132
132
|
key: cacheKey,
|
|
133
133
|
source
|
|
134
134
|
};
|
|
135
|
-
});
|
|
135
|
+
}));
|
|
136
136
|
}
|
|
137
137
|
debug('js handle finish, total: %d, no-cached: %d', groupedEntries.js.length, noCachedCount);
|
|
138
138
|
}
|
package/dist/vite.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
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-jf-1m663.js');
|
|
6
|
+
require('./options-AIjWBFPo.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -18,7 +18,7 @@ require('./defu-Cdz2PomB.js');
|
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
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');
|
|
@@ -29,7 +29,7 @@ require('tailwindcss-patch');
|
|
|
29
29
|
require('@tailwindcss-mangle/shared');
|
|
30
30
|
require('lru-cache');
|
|
31
31
|
require('md5');
|
|
32
|
-
require('./index-
|
|
32
|
+
require('./index-DyK5Vd4R.js');
|
|
33
33
|
require('debug');
|
|
34
34
|
|
|
35
35
|
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-
|
|
2
|
-
import './options-
|
|
1
|
+
export { U as UnifiedViteWeappTailwindcssPlugin } from './index-BatBMY3C.mjs';
|
|
2
|
+
import './options-D6Mza941.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -14,7 +14,7 @@ import './defu-n46TJT6t.mjs';
|
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
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';
|
|
@@ -25,5 +25,5 @@ import 'tailwindcss-patch';
|
|
|
25
25
|
import '@tailwindcss-mangle/shared';
|
|
26
26
|
import 'lru-cache';
|
|
27
27
|
import 'md5';
|
|
28
|
-
import './index-
|
|
28
|
+
import './index-CsZGfl55.mjs';
|
|
29
29
|
import 'debug';
|
package/dist/webpack.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var v5 = require('./v5-
|
|
6
|
-
require('./options-
|
|
5
|
+
var v5 = require('./v5-BV64BMJS.js');
|
|
6
|
+
require('./options-AIjWBFPo.js');
|
|
7
7
|
require('magic-string');
|
|
8
8
|
require('./replace.js');
|
|
9
9
|
require('@weapp-core/escape');
|
|
@@ -18,7 +18,7 @@ require('./defu-Cdz2PomB.js');
|
|
|
18
18
|
require('@babel/types');
|
|
19
19
|
require('htmlparser2');
|
|
20
20
|
require('postcss');
|
|
21
|
-
require('./index-
|
|
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');
|
|
@@ -29,7 +29,7 @@ require('tailwindcss-patch');
|
|
|
29
29
|
require('@tailwindcss-mangle/shared');
|
|
30
30
|
require('lru-cache');
|
|
31
31
|
require('md5');
|
|
32
|
-
require('./index-
|
|
32
|
+
require('./index-DyK5Vd4R.js');
|
|
33
33
|
require('debug');
|
|
34
34
|
|
|
35
35
|
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { U as UnifiedWebpackPluginV5 } from './v5-
|
|
2
|
-
import './options-
|
|
1
|
+
export { U as UnifiedWebpackPluginV5 } from './v5-CH-EIloz.mjs';
|
|
2
|
+
import './options-D6Mza941.mjs';
|
|
3
3
|
import 'magic-string';
|
|
4
4
|
import './replace.mjs';
|
|
5
5
|
import '@weapp-core/escape';
|
|
@@ -14,7 +14,7 @@ import './defu-n46TJT6t.mjs';
|
|
|
14
14
|
import '@babel/types';
|
|
15
15
|
import 'htmlparser2';
|
|
16
16
|
import 'postcss';
|
|
17
|
-
import './index-
|
|
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';
|
|
@@ -25,5 +25,5 @@ import 'tailwindcss-patch';
|
|
|
25
25
|
import '@tailwindcss-mangle/shared';
|
|
26
26
|
import 'lru-cache';
|
|
27
27
|
import 'md5';
|
|
28
|
-
import './index-
|
|
28
|
+
import './index-CsZGfl55.mjs';
|
|
29
29
|
import 'debug';
|