weapp-tailwindcss 4.3.3 → 4.4.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/chunk-2NRTWL47.js +43 -0
- package/dist/{chunk-GFQ2R7SX.mjs → chunk-3MSGCIVH.mjs} +127 -129
- package/dist/{chunk-3KMEJ2LM.js → chunk-AEJDBNAX.js} +540 -315
- package/dist/{chunk-M7PVNKCH.mjs → chunk-AXYGCCZW.mjs} +45 -57
- package/dist/chunk-E2LRXNZ3.js +122 -0
- package/dist/{chunk-L36QGA7Y.mjs → chunk-FBGUUXQV.mjs} +1 -1
- package/dist/{chunk-A75TB5TE.js → chunk-FOSGDQZ7.js} +34 -43
- package/dist/chunk-H4JTYYOI.mjs +43 -0
- package/dist/{chunk-5BTC4YQI.mjs → chunk-IHKVNALD.mjs} +29 -38
- package/dist/chunk-KAKRCCPX.mjs +122 -0
- package/dist/{chunk-L7VNJFIK.js → chunk-NZ7VALIM.js} +129 -131
- package/dist/{chunk-JDLLZFZX.js → chunk-PPTSD6TQ.js} +46 -58
- package/dist/{chunk-O3G5TVND.js → chunk-RBRSMHFS.js} +1 -1
- package/dist/chunk-UW3WHSZ5.js +39 -0
- package/dist/{chunk-3KXFKRIX.mjs → chunk-WCIVXE2D.mjs} +539 -314
- package/dist/chunk-ZNKIYZRQ.mjs +39 -0
- package/dist/cli.js +5 -8
- package/dist/cli.mjs +4 -7
- package/dist/core.js +5 -5
- package/dist/core.mjs +4 -4
- package/dist/css-macro/postcss.js +1 -1
- package/dist/css-macro/postcss.mjs +1 -1
- package/dist/css-macro.js +3 -3
- package/dist/css-macro.mjs +2 -2
- package/dist/defaults.js +4 -4
- package/dist/defaults.mjs +3 -3
- package/dist/escape.js +1 -1
- package/dist/escape.mjs +1 -1
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +6 -6
- package/dist/index.js +9 -9
- package/dist/index.mjs +8 -8
- package/dist/postcss-html-transform.js +1 -1
- package/dist/postcss-html-transform.mjs +1 -1
- package/dist/presets.js +3 -3
- package/dist/presets.mjs +2 -2
- package/dist/types.d.mts +247 -246
- package/dist/types.d.ts +247 -246
- package/dist/types.js +1 -1
- package/dist/types.mjs +1 -1
- package/dist/vite.js +7 -7
- package/dist/vite.mjs +6 -6
- package/dist/webpack.js +7 -7
- package/dist/webpack.mjs +6 -6
- package/dist/webpack4.js +48 -63
- package/dist/webpack4.mjs +46 -61
- package/package.json +4 -5
- package/dist/chunk-3AUX4FGE.mjs +0 -13
- package/dist/chunk-GEUHO2UC.mjs +0 -141
- package/dist/chunk-LSSLYD6B.js +0 -13
- package/dist/chunk-QXQOYYCR.js +0 -26
- package/dist/chunk-TI4R65TB.js +0 -141
- package/dist/chunk-Y5AFAYKI.mjs +0 -26
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
var _chunk2NRTWL47js = require('./chunk-2NRTWL47.js');
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
var _chunkOGROHM4Ljs = require('./chunk-OGROHM4L.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
var
|
|
11
|
+
var _chunkAEJDBNAXjs = require('./chunk-AEJDBNAX.js');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
var _chunkPLMJW644js = require('./chunk-PLMJW644.js');
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
var
|
|
17
|
+
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
17
18
|
|
|
18
19
|
// src/bundlers/vite/index.ts
|
|
19
20
|
var _htmltransform = require('@weapp-tailwindcss/postcss/html-transform'); var _htmltransform2 = _interopRequireDefault(_htmltransform);
|
|
@@ -24,10 +25,32 @@ var _magicstring = require('magic-string'); var _magicstring2 = _interopRequireD
|
|
|
24
25
|
var _compilersfc = require('vue/compiler-sfc');
|
|
25
26
|
function traverse(node, visitor) {
|
|
26
27
|
visitor(node);
|
|
27
|
-
if (node.children) {
|
|
28
|
-
node.children
|
|
28
|
+
if (Array.isArray(node.children)) {
|
|
29
|
+
for (const child of node.children) {
|
|
30
|
+
if (child && typeof child === "object" && "type" in child) {
|
|
31
|
+
traverse(child, visitor);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
35
|
}
|
|
36
|
+
function createClassAttributeUpdater(ms) {
|
|
37
|
+
return (prop) => {
|
|
38
|
+
if (prop.value) {
|
|
39
|
+
ms.update(prop.value.loc.start.offset + 1, prop.value.loc.end.offset - 1, _chunkPLMJW644js.replaceWxml.call(void 0, prop.value.content));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function createClassDirectiveUpdater(ms, jsHandler, runtimeSet) {
|
|
44
|
+
return (prop) => {
|
|
45
|
+
if (_optionalChain([prop, 'access', _ => _.arg, 'optionalAccess', _2 => _2.type]) === _compilerdom.NodeTypes.SIMPLE_EXPRESSION && prop.arg.content === "class" && _optionalChain([prop, 'access', _3 => _3.exp, 'optionalAccess', _4 => _4.type]) === _compilerdom.NodeTypes.SIMPLE_EXPRESSION) {
|
|
46
|
+
const generated = _chunkAEJDBNAXjs.generateCode.call(void 0, prop.exp.content, {
|
|
47
|
+
jsHandler,
|
|
48
|
+
runtimeSet
|
|
49
|
+
});
|
|
50
|
+
ms.update(prop.exp.loc.start.offset, prop.exp.loc.end.offset, generated);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
31
54
|
var defaultCreateJsHandlerOptions = {
|
|
32
55
|
babelParserOptions: {
|
|
33
56
|
plugins: [
|
|
@@ -42,27 +65,21 @@ function transformUVue(code, id, jsHandler, runtimeSet) {
|
|
|
42
65
|
const ms = new (0, _magicstring2.default)(code);
|
|
43
66
|
const { descriptor, errors } = _compilersfc.parse.call(void 0, code);
|
|
44
67
|
if (errors.length === 0) {
|
|
45
|
-
if (descriptor.template) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
ms.update(prop.exp.loc.start.offset, prop.exp.loc.end.offset, code2);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
68
|
+
if (_optionalChain([descriptor, 'access', _5 => _5.template, 'optionalAccess', _6 => _6.ast])) {
|
|
69
|
+
const updateStaticClass = createClassAttributeUpdater(ms);
|
|
70
|
+
const updateDynamicClass = createClassDirectiveUpdater(ms, jsHandler, runtimeSet);
|
|
71
|
+
traverse(descriptor.template.ast, (node) => {
|
|
72
|
+
if (node.type !== _compilerdom.NodeTypes.ELEMENT) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
for (const prop of node.props) {
|
|
76
|
+
if (prop.type === _compilerdom.NodeTypes.ATTRIBUTE && prop.name === "class") {
|
|
77
|
+
updateStaticClass(prop);
|
|
78
|
+
} else if (prop.type === _compilerdom.NodeTypes.DIRECTIVE && prop.name === "bind") {
|
|
79
|
+
updateDynamicClass(prop);
|
|
80
|
+
}
|
|
62
81
|
}
|
|
63
|
-
};
|
|
64
|
-
var extractClassNames = extractClassNames2;
|
|
65
|
-
traverse(descriptor.template.ast, extractClassNames2);
|
|
82
|
+
});
|
|
66
83
|
}
|
|
67
84
|
if (descriptor.script) {
|
|
68
85
|
const { code: code2 } = jsHandler(descriptor.script.content, _nullishCoalesce(runtimeSet, () => ( /* @__PURE__ */ new Set())), defaultCreateJsHandlerOptions);
|
|
@@ -146,9 +163,9 @@ async function formatPostcssSourceMap(rawMap, file) {
|
|
|
146
163
|
}
|
|
147
164
|
|
|
148
165
|
// src/bundlers/vite/index.ts
|
|
149
|
-
var debug =
|
|
166
|
+
var debug = _chunk2NRTWL47js.createDebug.call(void 0, );
|
|
150
167
|
function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
151
|
-
const opts =
|
|
168
|
+
const opts = _chunkAEJDBNAXjs.getCompilerContext.call(void 0, options);
|
|
152
169
|
const {
|
|
153
170
|
disabled,
|
|
154
171
|
onEnd,
|
|
@@ -191,135 +208,118 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
191
208
|
debug("start");
|
|
192
209
|
onStart();
|
|
193
210
|
const entries = Object.entries(bundle);
|
|
194
|
-
const groupedEntries =
|
|
211
|
+
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, opts);
|
|
195
212
|
runtimeSet = await twPatcher.getClassSet();
|
|
196
213
|
setMangleRuntimeSet(runtimeSet);
|
|
197
214
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
198
|
-
const
|
|
215
|
+
const tasks = [];
|
|
199
216
|
if (Array.isArray(groupedEntries.html)) {
|
|
200
|
-
for (const
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const source = cache.get(file);
|
|
210
|
-
if (source) {
|
|
211
|
-
originalSource.source = source;
|
|
212
|
-
debug("html cache hit: %s", file);
|
|
213
|
-
} else {
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
217
|
+
for (const [file, originalSource] of groupedEntries.html) {
|
|
218
|
+
const rawSource = originalSource.source.toString();
|
|
219
|
+
tasks.push(
|
|
220
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
221
|
+
cache,
|
|
222
|
+
cacheKey: file,
|
|
223
|
+
rawSource,
|
|
224
|
+
applyResult(source) {
|
|
225
|
+
originalSource.source = source;
|
|
216
226
|
},
|
|
217
|
-
|
|
218
|
-
|
|
227
|
+
onCacheHit() {
|
|
228
|
+
debug("html cache hit: %s", file);
|
|
229
|
+
},
|
|
230
|
+
async transform() {
|
|
231
|
+
const transformed = await templateHandler(rawSource, {
|
|
219
232
|
runtimeSet
|
|
220
233
|
});
|
|
221
|
-
onUpdate(file,
|
|
234
|
+
onUpdate(file, rawSource, transformed);
|
|
222
235
|
debug("html handle: %s", file);
|
|
223
236
|
return {
|
|
224
|
-
|
|
225
|
-
source: originalSource.source
|
|
237
|
+
result: transformed
|
|
226
238
|
};
|
|
227
239
|
}
|
|
228
|
-
)
|
|
240
|
+
})
|
|
229
241
|
);
|
|
230
242
|
}
|
|
231
243
|
}
|
|
232
244
|
if (Array.isArray(groupedEntries.js)) {
|
|
233
|
-
for (const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const source = cache.get(file);
|
|
243
|
-
if (source) {
|
|
245
|
+
for (const [file, originalSource] of groupedEntries.js) {
|
|
246
|
+
if (originalSource.type === "chunk") {
|
|
247
|
+
const rawSource = originalSource.code;
|
|
248
|
+
tasks.push(
|
|
249
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
250
|
+
cache,
|
|
251
|
+
cacheKey: file,
|
|
252
|
+
rawSource,
|
|
253
|
+
applyResult(source) {
|
|
244
254
|
originalSource.code = source;
|
|
255
|
+
},
|
|
256
|
+
onCacheHit() {
|
|
245
257
|
debug("js cache hit: %s", file);
|
|
246
|
-
} else {
|
|
247
|
-
return false;
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
async () => {
|
|
251
|
-
const { code } = await jsHandler(rawSource, runtimeSet);
|
|
252
|
-
originalSource.code = code;
|
|
253
|
-
onUpdate(file, rawSource, code);
|
|
254
|
-
debug("js handle: %s", file);
|
|
255
|
-
return {
|
|
256
|
-
key: file,
|
|
257
|
-
source: code
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
)
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
if (uniAppX) {
|
|
264
|
-
for (const element of groupedEntries.js.filter((x) => x[1].type === "asset")) {
|
|
265
|
-
const [file, originalSource] = element;
|
|
266
|
-
const rawSource = originalSource.source.toString();
|
|
267
|
-
const hash = cache.computeHash(rawSource);
|
|
268
|
-
cache.calcHashValueChanged(file, hash);
|
|
269
|
-
promises.push(
|
|
270
|
-
cache.process(
|
|
271
|
-
file,
|
|
272
|
-
() => {
|
|
273
|
-
const source = cache.get(file);
|
|
274
|
-
if (source) {
|
|
275
|
-
originalSource.source = source;
|
|
276
|
-
debug("js cache hit: %s", file);
|
|
277
|
-
} else {
|
|
278
|
-
return false;
|
|
279
|
-
}
|
|
280
258
|
},
|
|
281
|
-
async ()
|
|
282
|
-
const { code } = await jsHandler(rawSource, runtimeSet
|
|
283
|
-
uniAppX,
|
|
284
|
-
babelParserOptions: {
|
|
285
|
-
plugins: [
|
|
286
|
-
"typescript"
|
|
287
|
-
],
|
|
288
|
-
sourceType: "unambiguous"
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
originalSource.source = code;
|
|
259
|
+
async transform() {
|
|
260
|
+
const { code } = await jsHandler(rawSource, runtimeSet);
|
|
292
261
|
onUpdate(file, rawSource, code);
|
|
293
262
|
debug("js handle: %s", file);
|
|
294
263
|
return {
|
|
295
|
-
|
|
296
|
-
source: code
|
|
264
|
+
result: code
|
|
297
265
|
};
|
|
298
266
|
}
|
|
299
|
-
)
|
|
267
|
+
})
|
|
300
268
|
);
|
|
301
269
|
}
|
|
302
270
|
}
|
|
271
|
+
if (uniAppX) {
|
|
272
|
+
for (const [file, originalSource] of groupedEntries.js) {
|
|
273
|
+
if (originalSource.type === "asset") {
|
|
274
|
+
const rawSource = originalSource.source.toString();
|
|
275
|
+
tasks.push(
|
|
276
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
277
|
+
cache,
|
|
278
|
+
cacheKey: file,
|
|
279
|
+
rawSource,
|
|
280
|
+
applyResult(source) {
|
|
281
|
+
originalSource.source = source;
|
|
282
|
+
},
|
|
283
|
+
onCacheHit() {
|
|
284
|
+
debug("js cache hit: %s", file);
|
|
285
|
+
},
|
|
286
|
+
async transform() {
|
|
287
|
+
const { code } = await jsHandler(rawSource, runtimeSet, {
|
|
288
|
+
uniAppX,
|
|
289
|
+
babelParserOptions: {
|
|
290
|
+
plugins: [
|
|
291
|
+
"typescript"
|
|
292
|
+
],
|
|
293
|
+
sourceType: "unambiguous"
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
onUpdate(file, rawSource, code);
|
|
297
|
+
debug("js handle: %s", file);
|
|
298
|
+
return {
|
|
299
|
+
result: code
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
})
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
303
307
|
}
|
|
304
308
|
if (Array.isArray(groupedEntries.css)) {
|
|
305
|
-
for (const
|
|
306
|
-
const [file, originalSource] = element;
|
|
309
|
+
for (const [file, originalSource] of groupedEntries.css) {
|
|
307
310
|
const rawSource = originalSource.source.toString();
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
()
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
} else {
|
|
319
|
-
return false;
|
|
320
|
-
}
|
|
311
|
+
tasks.push(
|
|
312
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
313
|
+
cache,
|
|
314
|
+
cacheKey: file,
|
|
315
|
+
rawSource,
|
|
316
|
+
applyResult(source) {
|
|
317
|
+
originalSource.source = source;
|
|
318
|
+
},
|
|
319
|
+
onCacheHit() {
|
|
320
|
+
debug("css cache hit: %s", file);
|
|
321
321
|
},
|
|
322
|
-
async ()
|
|
322
|
+
async transform() {
|
|
323
323
|
const { css } = await styleHandler(rawSource, {
|
|
324
324
|
isMainChunk: mainCssChunkMatcher(originalSource.fileName, appType),
|
|
325
325
|
postcssOptions: {
|
|
@@ -329,19 +329,17 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
|
|
|
329
329
|
},
|
|
330
330
|
majorVersion: twPatcher.majorVersion
|
|
331
331
|
});
|
|
332
|
-
originalSource.source = css;
|
|
333
332
|
onUpdate(file, rawSource, css);
|
|
334
333
|
debug("css handle: %s", file);
|
|
335
334
|
return {
|
|
336
|
-
|
|
337
|
-
source: css
|
|
335
|
+
result: css
|
|
338
336
|
};
|
|
339
337
|
}
|
|
340
|
-
)
|
|
338
|
+
})
|
|
341
339
|
);
|
|
342
340
|
}
|
|
343
341
|
}
|
|
344
|
-
await Promise.all(
|
|
342
|
+
await Promise.all(tasks);
|
|
345
343
|
onEnd();
|
|
346
344
|
debug("end");
|
|
347
345
|
}
|
|
@@ -3,24 +3,25 @@
|
|
|
3
3
|
var _chunk6GP37C26js = require('./chunk-6GP37C26.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
var _chunk2NRTWL47js = require('./chunk-2NRTWL47.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
var _chunkOGROHM4Ljs = require('./chunk-OGROHM4L.js');
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
var
|
|
13
|
+
var _chunkAEJDBNAXjs = require('./chunk-AEJDBNAX.js');
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
var
|
|
16
|
+
var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
|
|
16
17
|
|
|
17
18
|
// src/bundlers/webpack/BaseUnifiedPlugin/v5.ts
|
|
18
19
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
19
20
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
20
|
-
var debug =
|
|
21
|
+
var debug = _chunk2NRTWL47js.createDebug.call(void 0, );
|
|
21
22
|
var UnifiedWebpackPluginV5 = class {
|
|
22
23
|
constructor(options = {}) {
|
|
23
|
-
this.options =
|
|
24
|
+
this.options = _chunkAEJDBNAXjs.getCompilerContext.call(void 0, options);
|
|
24
25
|
this.appType = this.options.appType;
|
|
25
26
|
}
|
|
26
27
|
apply(compiler) {
|
|
@@ -84,44 +85,39 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
const entries = Object.entries(assets);
|
|
87
|
-
const groupedEntries =
|
|
88
|
+
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
88
89
|
const runtimeSet = await twPatcher.getClassSet();
|
|
89
90
|
setMangleRuntimeSet(runtimeSet);
|
|
90
91
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
91
|
-
const
|
|
92
|
+
const tasks = [];
|
|
92
93
|
if (Array.isArray(groupedEntries.html)) {
|
|
93
94
|
for (const element of groupedEntries.html) {
|
|
94
95
|
const [file, originalSource] = element;
|
|
95
96
|
const rawSource = originalSource.source().toString();
|
|
96
|
-
const hash = cache.computeHash(rawSource);
|
|
97
97
|
const cacheKey = file;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
tasks.push(
|
|
99
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
100
|
+
cache,
|
|
101
101
|
cacheKey,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
102
|
+
rawSource,
|
|
103
|
+
applyResult(source) {
|
|
104
|
+
compilation.updateAsset(file, source);
|
|
105
|
+
},
|
|
106
|
+
onCacheHit() {
|
|
107
|
+
debug("html cache hit: %s", file);
|
|
110
108
|
},
|
|
111
|
-
async () => {
|
|
109
|
+
transform: async () => {
|
|
112
110
|
const wxml = await templateHandler(rawSource, {
|
|
113
111
|
runtimeSet
|
|
114
112
|
});
|
|
115
113
|
const source = new ConcatSource(wxml);
|
|
116
|
-
compilation.updateAsset(file, source);
|
|
117
114
|
onUpdate(file, rawSource, wxml);
|
|
118
115
|
debug("html handle: %s", file);
|
|
119
116
|
return {
|
|
120
|
-
|
|
121
|
-
source
|
|
117
|
+
result: source
|
|
122
118
|
};
|
|
123
119
|
}
|
|
124
|
-
)
|
|
120
|
+
})
|
|
125
121
|
);
|
|
126
122
|
}
|
|
127
123
|
}
|
|
@@ -129,31 +125,28 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
129
125
|
for (const element of groupedEntries.js) {
|
|
130
126
|
const [file, originalSource] = element;
|
|
131
127
|
const cacheKey = _chunk6GP37C26js.getCacheKey.call(void 0, file);
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
const rawSource = originalSource.source().toString();
|
|
129
|
+
tasks.push(
|
|
130
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
131
|
+
cache,
|
|
134
132
|
cacheKey,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
compilation.updateAsset(file, source);
|
|
139
|
-
debug("js cache hit: %s", file);
|
|
140
|
-
} else {
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
133
|
+
rawSource,
|
|
134
|
+
applyResult(source) {
|
|
135
|
+
compilation.updateAsset(file, source);
|
|
143
136
|
},
|
|
144
|
-
|
|
145
|
-
|
|
137
|
+
onCacheHit() {
|
|
138
|
+
debug("js cache hit: %s", file);
|
|
139
|
+
},
|
|
140
|
+
transform: async () => {
|
|
146
141
|
const { code } = await jsHandler(rawSource, runtimeSet);
|
|
147
142
|
const source = new ConcatSource(code);
|
|
148
|
-
compilation.updateAsset(file, source);
|
|
149
143
|
onUpdate(file, rawSource, code);
|
|
150
144
|
debug("js handle: %s", file);
|
|
151
145
|
return {
|
|
152
|
-
|
|
153
|
-
source
|
|
146
|
+
result: source
|
|
154
147
|
};
|
|
155
148
|
}
|
|
156
|
-
)
|
|
149
|
+
})
|
|
157
150
|
);
|
|
158
151
|
}
|
|
159
152
|
}
|
|
@@ -161,22 +154,19 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
161
154
|
for (const element of groupedEntries.css) {
|
|
162
155
|
const [file, originalSource] = element;
|
|
163
156
|
const rawSource = originalSource.source().toString();
|
|
164
|
-
const hash = cache.computeHash(rawSource);
|
|
165
157
|
const cacheKey = file;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
tasks.push(
|
|
159
|
+
_chunk2NRTWL47js.processCachedTask.call(void 0, {
|
|
160
|
+
cache,
|
|
169
161
|
cacheKey,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
compilation.updateAsset(file, source);
|
|
174
|
-
debug("css cache hit: %s", file);
|
|
175
|
-
} else {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
162
|
+
rawSource,
|
|
163
|
+
applyResult(source) {
|
|
164
|
+
compilation.updateAsset(file, source);
|
|
178
165
|
},
|
|
179
|
-
|
|
166
|
+
onCacheHit() {
|
|
167
|
+
debug("css cache hit: %s", file);
|
|
168
|
+
},
|
|
169
|
+
transform: async () => {
|
|
180
170
|
const { css } = await styleHandler(rawSource, {
|
|
181
171
|
isMainChunk: mainCssChunkMatcher(file, this.appType),
|
|
182
172
|
postcssOptions: {
|
|
@@ -187,19 +177,17 @@ var UnifiedWebpackPluginV5 = class {
|
|
|
187
177
|
majorVersion: twPatcher.majorVersion
|
|
188
178
|
});
|
|
189
179
|
const source = new ConcatSource(css);
|
|
190
|
-
compilation.updateAsset(file, source);
|
|
191
180
|
onUpdate(file, rawSource, css);
|
|
192
181
|
debug("css handle: %s", file);
|
|
193
182
|
return {
|
|
194
|
-
|
|
195
|
-
source
|
|
183
|
+
result: source
|
|
196
184
|
};
|
|
197
185
|
}
|
|
198
|
-
)
|
|
186
|
+
})
|
|
199
187
|
);
|
|
200
188
|
}
|
|
201
189
|
}
|
|
202
|
-
await Promise.all(
|
|
190
|
+
await Promise.all(tasks);
|
|
203
191
|
debug("end");
|
|
204
192
|
onEnd();
|
|
205
193
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.5_jiti@2.6.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.5_jiti@2.6.1_postcss@8.5.6_tsx@4.20.6_typescript@5.9.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
|
|
2
2
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
3
3
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
4
4
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/index.ts
|
|
2
|
+
var _shared = require('@weapp-tailwindcss/shared');
|
|
3
|
+
function classifyEntry(filename, options) {
|
|
4
|
+
if (options.cssMatcher(filename)) {
|
|
5
|
+
return "css";
|
|
6
|
+
}
|
|
7
|
+
if (options.htmlMatcher(filename)) {
|
|
8
|
+
return "html";
|
|
9
|
+
}
|
|
10
|
+
if (options.jsMatcher(filename) || options.wxsMatcher(filename)) {
|
|
11
|
+
return "js";
|
|
12
|
+
}
|
|
13
|
+
return "other";
|
|
14
|
+
}
|
|
15
|
+
function createEmptyGroups() {
|
|
16
|
+
return {
|
|
17
|
+
css: [],
|
|
18
|
+
html: [],
|
|
19
|
+
js: [],
|
|
20
|
+
other: []
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function getGroupedEntries(entries, options) {
|
|
24
|
+
const groups = createEmptyGroups();
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
const [filename] = entry;
|
|
27
|
+
const group = classifyEntry(filename, options);
|
|
28
|
+
groups[group].push(entry);
|
|
29
|
+
}
|
|
30
|
+
return groups;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.defu = _shared.defu; exports.defuOverrideArray = _shared.defuOverrideArray; exports.isMap = _shared.isMap; exports.noop = _shared.noop; exports.getGroupedEntries = getGroupedEntries;
|