weapp-tailwindcss 4.7.0 → 4.7.2

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.
Files changed (39) hide show
  1. package/dist/{chunk-Q5TPAJI4.js → chunk-2SI3KT2H.js} +7 -6
  2. package/dist/{chunk-IY2OKZE6.mjs → chunk-3ARXMTWC.mjs} +21 -8
  3. package/dist/{chunk-D7SF52F6.mjs → chunk-5BW6X6AJ.mjs} +42 -36
  4. package/dist/chunk-667CYXAH.mjs +133 -0
  5. package/dist/chunk-BUMQQPAO.js +133 -0
  6. package/dist/{chunk-W3JU6K3T.js → chunk-FPDJ3BCM.js} +260 -108
  7. package/dist/{chunk-BAXZHBSU.js → chunk-GNWJEIZZ.js} +92 -77
  8. package/dist/{chunk-7TKAJ3P6.mjs → chunk-JYCQWWYU.mjs} +257 -105
  9. package/dist/{chunk-NRG7N2Q7.mjs → chunk-KZJLIZIK.mjs} +0 -1
  10. package/dist/{chunk-34T2BFTJ.mjs → chunk-KZUIVLPP.mjs} +42 -1
  11. package/dist/{chunk-C3CG4UUY.js → chunk-OPTIAB5G.js} +21 -8
  12. package/dist/{chunk-BTOCLUJ4.mjs → chunk-Q6PLZCM6.mjs} +6 -5
  13. package/dist/{chunk-CCMDCC3N.js → chunk-QZRXYCOQ.js} +49 -43
  14. package/dist/{chunk-WVKK6TBL.js → chunk-W7BVY5S5.js} +42 -1
  15. package/dist/{chunk-LZ6L3UQO.js → chunk-WXBFAARR.js} +0 -1
  16. package/dist/{chunk-KSXOBEXQ.mjs → chunk-Z2H7M33Z.mjs} +83 -68
  17. package/dist/cli.js +6 -6
  18. package/dist/cli.mjs +3 -3
  19. package/dist/core.js +10 -9
  20. package/dist/core.mjs +10 -9
  21. package/dist/defaults.js +2 -2
  22. package/dist/defaults.mjs +1 -1
  23. package/dist/gulp.js +6 -6
  24. package/dist/gulp.mjs +5 -5
  25. package/dist/index.js +9 -9
  26. package/dist/index.mjs +8 -8
  27. package/dist/presets.js +2 -2
  28. package/dist/presets.mjs +1 -1
  29. package/dist/types.d.mts +2 -21
  30. package/dist/types.d.ts +2 -21
  31. package/dist/vite.js +7 -7
  32. package/dist/vite.mjs +6 -6
  33. package/dist/webpack.js +7 -7
  34. package/dist/webpack.mjs +6 -6
  35. package/dist/webpack4.js +51 -45
  36. package/dist/webpack4.mjs +44 -38
  37. package/package.json +4 -4
  38. package/dist/chunk-FB5P4TRH.js +0 -70
  39. package/dist/chunk-YPBRGP6K.mjs +0 -70
@@ -4,18 +4,20 @@ var _chunk6GP37C26js = require('./chunk-6GP37C26.js');
4
4
 
5
5
 
6
6
 
7
- var _chunkWVKK6TBLjs = require('./chunk-WVKK6TBL.js');
7
+
8
+ var _chunkW7BVY5S5js = require('./chunk-W7BVY5S5.js');
8
9
 
9
10
 
10
11
  var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
11
12
 
12
13
 
13
14
 
14
- var _chunkFB5P4TRHjs = require('./chunk-FB5P4TRH.js');
15
+
16
+ var _chunkBUMQQPAOjs = require('./chunk-BUMQQPAO.js');
15
17
 
16
18
 
17
19
 
18
- var _chunkW3JU6K3Tjs = require('./chunk-W3JU6K3T.js');
20
+ var _chunkFPDJ3BCMjs = require('./chunk-FPDJ3BCM.js');
19
21
 
20
22
 
21
23
  var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
@@ -24,10 +26,10 @@ var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
24
26
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
25
27
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
26
28
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
27
- var debug = _chunkFB5P4TRHjs.createDebug.call(void 0, );
29
+ var debug = _chunkBUMQQPAOjs.createDebug.call(void 0, );
28
30
  var UnifiedWebpackPluginV5 = class {
29
31
  constructor(options = {}) {
30
- this.options = _chunkW3JU6K3Tjs.getCompilerContext.call(void 0, options);
32
+ this.options = _chunkFPDJ3BCMjs.getCompilerContext.call(void 0, options);
31
33
  this.appType = this.options.appType;
32
34
  }
33
35
  apply(compiler) {
@@ -48,12 +50,12 @@ var UnifiedWebpackPluginV5 = class {
48
50
  if (disabled) {
49
51
  return;
50
52
  }
51
- const patchPromise = Promise.resolve(twPatcher.patch());
53
+ const patchPromise = _chunkBUMQQPAOjs.createTailwindPatchPromise.call(void 0, twPatcher);
52
54
  const { Compilation, sources, NormalModule } = compiler.webpack;
53
55
  const { ConcatSource } = sources;
54
56
  async function getClassSetInLoader() {
55
57
  await patchPromise;
56
- await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
58
+ await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
57
59
  }
58
60
  onLoad();
59
61
  const loader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-loader.js")));
@@ -66,8 +68,8 @@ var UnifiedWebpackPluginV5 = class {
66
68
  ident: null,
67
69
  type: null
68
70
  };
69
- compiler.hooks.compilation.tap(_chunkW3JU6K3Tjs.pluginName, (compilation) => {
70
- NormalModule.getCompilationHooks(compilation).loader.tap(_chunkW3JU6K3Tjs.pluginName, (_loaderContext, module) => {
71
+ compiler.hooks.compilation.tap(_chunkFPDJ3BCMjs.pluginName, (compilation) => {
72
+ NormalModule.getCompilationHooks(compilation).loader.tap(_chunkFPDJ3BCMjs.pluginName, (_loaderContext, module) => {
71
73
  if (isExisted) {
72
74
  const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
73
75
  if (idx > -1) {
@@ -77,7 +79,7 @@ var UnifiedWebpackPluginV5 = class {
77
79
  });
78
80
  compilation.hooks.processAssets.tapPromise(
79
81
  {
80
- name: _chunkW3JU6K3Tjs.pluginName,
82
+ name: _chunkFPDJ3BCMjs.pluginName,
81
83
  stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
82
84
  },
83
85
  async (assets) => {
@@ -95,13 +97,13 @@ var UnifiedWebpackPluginV5 = class {
95
97
  const jsAssets = /* @__PURE__ */ new Map();
96
98
  for (const [file] of entries) {
97
99
  if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
98
- const absolute = _chunkWVKK6TBLjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
100
+ const absolute = _chunkW7BVY5S5js.toAbsoluteOutputPath.call(void 0, file, outputDir);
99
101
  jsAssets.set(absolute, file);
100
102
  }
101
103
  }
102
104
  const moduleGraphOptions = {
103
105
  resolve(specifier, importer) {
104
- return _chunkWVKK6TBLjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
106
+ return _chunkW7BVY5S5js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
105
107
  },
106
108
  load: (id) => {
107
109
  const assetName = jsAssets.get(id);
@@ -144,7 +146,7 @@ var UnifiedWebpackPluginV5 = class {
144
146
  }
145
147
  };
146
148
  const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
147
- const runtimeSet = await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
149
+ const runtimeSet = await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
148
150
  debug("get runtimeSet, class count: %d", runtimeSet.size);
149
151
  const tasks = [];
150
152
  if (Array.isArray(groupedEntries.html)) {
@@ -178,6 +180,7 @@ var UnifiedWebpackPluginV5 = class {
178
180
  );
179
181
  }
180
182
  }
183
+ const jsTaskFactories = [];
181
184
  if (Array.isArray(groupedEntries.js)) {
182
185
  for (const [file] of groupedEntries.js) {
183
186
  const cacheKey = _chunk6GP37C26js.getCacheKey.call(void 0, file);
@@ -185,38 +188,40 @@ var UnifiedWebpackPluginV5 = class {
185
188
  if (!asset) {
186
189
  continue;
187
190
  }
188
- const absoluteFile = _chunkWVKK6TBLjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
191
+ const absoluteFile = _chunkW7BVY5S5js.toAbsoluteOutputPath.call(void 0, file, outputDir);
189
192
  const initialSource = asset.source.source();
190
193
  const initialRawSource = typeof initialSource === "string" ? initialSource : initialSource.toString();
191
- await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
192
- cache,
193
- cacheKey,
194
- rawSource: initialRawSource,
195
- applyResult(source) {
196
- compilation.updateAsset(file, source);
197
- },
198
- onCacheHit() {
199
- debug("js cache hit: %s", file);
200
- },
201
- transform: async () => {
202
- const currentAsset = compilation.getAsset(file);
203
- const currentSourceValue = _optionalChain([currentAsset, 'optionalAccess', _5 => _5.source, 'access', _6 => _6.source, 'call', _7 => _7()]);
204
- const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : _nullishCoalesce(_optionalChain([currentSourceValue, 'optionalAccess', _8 => _8.toString, 'call', _9 => _9()]), () => ( ""));
205
- const { code, linked } = await jsHandler(currentSource, runtimeSet, {
206
- filename: absoluteFile,
207
- moduleGraph: moduleGraphOptions,
208
- babelParserOptions: {
209
- sourceFilename: absoluteFile
210
- }
211
- });
212
- const source = new ConcatSource(code);
213
- onUpdate(file, currentSource, code);
214
- debug("js handle: %s", file);
215
- applyLinkedResults(linked);
216
- return {
217
- result: source
218
- };
219
- }
194
+ jsTaskFactories.push(async () => {
195
+ await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
196
+ cache,
197
+ cacheKey,
198
+ rawSource: initialRawSource,
199
+ applyResult(source) {
200
+ compilation.updateAsset(file, source);
201
+ },
202
+ onCacheHit() {
203
+ debug("js cache hit: %s", file);
204
+ },
205
+ transform: async () => {
206
+ const currentAsset = compilation.getAsset(file);
207
+ const currentSourceValue = _optionalChain([currentAsset, 'optionalAccess', _5 => _5.source, 'access', _6 => _6.source, 'call', _7 => _7()]);
208
+ const currentSource = typeof currentSourceValue === "string" ? currentSourceValue : _nullishCoalesce(_optionalChain([currentSourceValue, 'optionalAccess', _8 => _8.toString, 'call', _9 => _9()]), () => ( ""));
209
+ const { code, linked } = await jsHandler(currentSource, runtimeSet, {
210
+ filename: absoluteFile,
211
+ moduleGraph: moduleGraphOptions,
212
+ babelParserOptions: {
213
+ sourceFilename: absoluteFile
214
+ }
215
+ });
216
+ const source = new ConcatSource(code);
217
+ onUpdate(file, currentSource, code);
218
+ debug("js handle: %s", file);
219
+ applyLinkedResults(linked);
220
+ return {
221
+ result: source
222
+ };
223
+ }
224
+ });
220
225
  });
221
226
  }
222
227
  }
@@ -258,6 +263,7 @@ var UnifiedWebpackPluginV5 = class {
258
263
  );
259
264
  }
260
265
  }
266
+ _chunkW7BVY5S5js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
261
267
  await Promise.all(tasks);
262
268
  debug("end");
263
269
  onEnd();
@@ -53,7 +53,48 @@ function resolveOutputSpecifier(specifier, importer, outDir, hasOutput) {
53
53
  return matchWithExtensions(candidate, hasOutput);
54
54
  }
55
55
 
56
+ // src/bundlers/shared/run-tasks.ts
57
+ async function runWithConcurrency(factories, limit = Math.min(4, Math.max(1, factories.length))) {
58
+ if (factories.length === 0) {
59
+ return [];
60
+ }
61
+ const results = Array.from({ length: factories.length });
62
+ const executing = /* @__PURE__ */ new Set();
63
+ let cursor = 0;
64
+ const effectiveLimit = Math.max(1, limit);
65
+ const scheduleNext = () => {
66
+ if (cursor >= factories.length) {
67
+ return;
68
+ }
69
+ const currentIndex = cursor++;
70
+ const wrapped = Promise.resolve(factories[currentIndex]()).then((value) => {
71
+ results[currentIndex] = value;
72
+ }).finally(() => {
73
+ executing.delete(wrapped);
74
+ });
75
+ executing.add(wrapped);
76
+ };
77
+ while (cursor < factories.length && executing.size < effectiveLimit) {
78
+ scheduleNext();
79
+ }
80
+ while (cursor < factories.length) {
81
+ await Promise.race(executing);
82
+ scheduleNext();
83
+ }
84
+ await Promise.all(executing);
85
+ return results;
86
+ }
87
+ function pushConcurrentTaskFactories(queue, factories, limit) {
88
+ if (factories.length === 0) {
89
+ return;
90
+ }
91
+ queue.push(
92
+ runWithConcurrency(factories, limit).then(() => void 0)
93
+ );
94
+ }
95
+
96
+
56
97
 
57
98
 
58
99
 
59
- exports.toAbsoluteOutputPath = toAbsoluteOutputPath; exports.resolveOutputSpecifier = resolveOutputSpecifier;
100
+ exports.toAbsoluteOutputPath = toAbsoluteOutputPath; exports.resolveOutputSpecifier = resolveOutputSpecifier; exports.pushConcurrentTaskFactories = pushConcurrentTaskFactories;
@@ -67,7 +67,6 @@ function getDefaultOptions() {
67
67
  "border-color": "currentColor"
68
68
  },
69
69
  disabled: false,
70
- customRuleCallback: _chunkUW3WHSZ5js.noop,
71
70
  onLoad: _chunkUW3WHSZ5js.noop,
72
71
  onStart: _chunkUW3WHSZ5js.noop,
73
72
  onEnd: _chunkUW3WHSZ5js.noop,
@@ -1,19 +1,21 @@
1
1
  import {
2
+ pushConcurrentTaskFactories,
2
3
  resolveOutputSpecifier,
3
4
  toAbsoluteOutputPath
4
- } from "./chunk-34T2BFTJ.mjs";
5
+ } from "./chunk-KZUIVLPP.mjs";
5
6
  import {
6
7
  processCachedTask
7
8
  } from "./chunk-RRHPTTCP.mjs";
8
9
  import {
9
10
  collectRuntimeClassSet,
10
- createDebug
11
- } from "./chunk-YPBRGP6K.mjs";
11
+ createDebug,
12
+ createTailwindPatchPromise
13
+ } from "./chunk-667CYXAH.mjs";
12
14
  import {
13
15
  generateCode,
14
16
  getCompilerContext,
15
17
  vitePluginName
16
- } from "./chunk-7TKAJ3P6.mjs";
18
+ } from "./chunk-JYCQWWYU.mjs";
17
19
  import {
18
20
  replaceWxml
19
21
  } from "./chunk-VSRDBMDB.mjs";
@@ -215,7 +217,7 @@ function createBundleModuleGraphOptions(outputDir, entries) {
215
217
  }
216
218
  };
217
219
  }
218
- function applyLinkedResults(linked, entries, onLinkedUpdate) {
220
+ function applyLinkedResults(linked, entries, onLinkedUpdate, onApplied) {
219
221
  if (!linked) {
220
222
  return;
221
223
  }
@@ -233,6 +235,7 @@ function applyLinkedResults(linked, entries, onLinkedUpdate) {
233
235
  } else {
234
236
  entry.output.source = code;
235
237
  }
238
+ onApplied?.(entry, code);
236
239
  onLinkedUpdate(entry.fileName, previous, code);
237
240
  }
238
241
  }
@@ -256,7 +259,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
256
259
  if (disabled) {
257
260
  return;
258
261
  }
259
- const patchPromise = Promise.resolve(twPatcher.patch());
262
+ const patchPromise = createTailwindPatchPromise(twPatcher);
260
263
  let runtimeSet;
261
264
  let resolvedConfig;
262
265
  onLoad();
@@ -294,12 +297,22 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
294
297
  }
295
298
  const moduleGraphOptions = createBundleModuleGraphOptions(outDir, jsEntries);
296
299
  const groupedEntries = getGroupedEntries(entries, opts);
297
- runtimeSet = await collectRuntimeClassSet(twPatcher);
300
+ runtimeSet = await collectRuntimeClassSet(twPatcher, { force: true });
298
301
  debug("get runtimeSet, class count: %d", runtimeSet.size);
299
302
  const handleLinkedUpdate = (fileName, previous, next) => {
300
303
  onUpdate(fileName, previous, next);
301
304
  debug("js linked handle: %s", fileName);
302
305
  };
306
+ const pendingLinkedUpdates = [];
307
+ const scheduleLinkedApply = (entry, code) => {
308
+ pendingLinkedUpdates.push(() => {
309
+ if (entry.output.type === "chunk") {
310
+ entry.output.code = code;
311
+ } else {
312
+ entry.output.source = code;
313
+ }
314
+ });
315
+ };
303
316
  const createHandlerOptions = (absoluteFilename, extra) => ({
304
317
  ...extra,
305
318
  filename: absoluteFilename,
@@ -338,70 +351,68 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
338
351
  );
339
352
  }
340
353
  }
354
+ const jsTaskFactories = [];
341
355
  if (Array.isArray(groupedEntries.js)) {
342
356
  for (const [file, originalSource] of groupedEntries.js) {
343
- if (originalSource.type !== "chunk") {
344
- continue;
345
- }
346
- const absoluteFile = toAbsoluteOutputPath(file, outDir);
347
- const initialRawSource = originalSource.code;
348
- await processCachedTask({
349
- cache,
350
- cacheKey: file,
351
- rawSource: initialRawSource,
352
- applyResult(source) {
353
- originalSource.code = source;
354
- },
355
- onCacheHit() {
356
- debug("js cache hit: %s", file);
357
- },
358
- async transform() {
359
- const rawSource = originalSource.code;
360
- const { code, linked } = await jsHandler(rawSource, runtimeSet, createHandlerOptions(absoluteFile));
361
- onUpdate(file, rawSource, code);
362
- debug("js handle: %s", file);
363
- applyLinkedResults(linked, jsEntries, handleLinkedUpdate);
364
- return {
365
- result: code
366
- };
367
- }
368
- });
369
- }
370
- if (uniAppX) {
371
- for (const [file, originalSource] of groupedEntries.js) {
372
- if (originalSource.type !== "asset") {
373
- continue;
374
- }
357
+ if (originalSource.type === "chunk") {
358
+ const absoluteFile = toAbsoluteOutputPath(file, outDir);
359
+ const initialRawSource = originalSource.code;
360
+ jsTaskFactories.push(async () => {
361
+ await processCachedTask({
362
+ cache,
363
+ cacheKey: file,
364
+ rawSource: initialRawSource,
365
+ applyResult(source) {
366
+ originalSource.code = source;
367
+ },
368
+ onCacheHit() {
369
+ debug("js cache hit: %s", file);
370
+ },
371
+ async transform() {
372
+ const rawSource = originalSource.code;
373
+ const { code, linked } = await jsHandler(rawSource, runtimeSet, createHandlerOptions(absoluteFile));
374
+ onUpdate(file, rawSource, code);
375
+ debug("js handle: %s", file);
376
+ applyLinkedResults(linked, jsEntries, handleLinkedUpdate, scheduleLinkedApply);
377
+ return {
378
+ result: code
379
+ };
380
+ }
381
+ });
382
+ });
383
+ } else if (uniAppX && originalSource.type === "asset") {
375
384
  const absoluteFile = toAbsoluteOutputPath(file, outDir);
376
385
  const rawSource = originalSource.source.toString();
377
- await processCachedTask({
378
- cache,
379
- cacheKey: file,
380
- rawSource,
381
- applyResult(source) {
382
- originalSource.source = source;
383
- },
384
- onCacheHit() {
385
- debug("js cache hit: %s", file);
386
- },
387
- async transform() {
388
- const currentSource = originalSource.source.toString();
389
- const { code, linked } = await jsHandler(currentSource, runtimeSet, createHandlerOptions(absoluteFile, {
390
- uniAppX,
391
- babelParserOptions: {
392
- plugins: [
393
- "typescript"
394
- ],
395
- sourceType: "unambiguous"
396
- }
397
- }));
398
- onUpdate(file, currentSource, code);
399
- debug("js handle: %s", file);
400
- applyLinkedResults(linked, jsEntries, handleLinkedUpdate);
401
- return {
402
- result: code
403
- };
404
- }
386
+ jsTaskFactories.push(async () => {
387
+ await processCachedTask({
388
+ cache,
389
+ cacheKey: file,
390
+ rawSource,
391
+ applyResult(source) {
392
+ originalSource.source = source;
393
+ },
394
+ onCacheHit() {
395
+ debug("js cache hit: %s", file);
396
+ },
397
+ async transform() {
398
+ const currentSource = originalSource.source.toString();
399
+ const { code, linked } = await jsHandler(currentSource, runtimeSet, createHandlerOptions(absoluteFile, {
400
+ uniAppX,
401
+ babelParserOptions: {
402
+ plugins: [
403
+ "typescript"
404
+ ],
405
+ sourceType: "unambiguous"
406
+ }
407
+ }));
408
+ onUpdate(file, currentSource, code);
409
+ debug("js handle: %s", file);
410
+ applyLinkedResults(linked, jsEntries, handleLinkedUpdate, scheduleLinkedApply);
411
+ return {
412
+ result: code
413
+ };
414
+ }
415
+ });
405
416
  });
406
417
  }
407
418
  }
@@ -441,7 +452,11 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
441
452
  );
442
453
  }
443
454
  }
455
+ pushConcurrentTaskFactories(tasks, jsTaskFactories);
444
456
  await Promise.all(tasks);
457
+ for (const apply of pendingLinkedUpdates) {
458
+ apply();
459
+ }
445
460
  onEnd();
446
461
  debug("end");
447
462
  }
@@ -496,7 +511,7 @@ function UnifiedViteWeappTailwindcssPlugin(options = {}) {
496
511
  enforce: "pre",
497
512
  async buildStart() {
498
513
  await patchPromise;
499
- runtimeSet = await collectRuntimeClassSet(twPatcher);
514
+ runtimeSet = await collectRuntimeClassSet(twPatcher, { force: true });
500
515
  },
501
516
  transform(code, id) {
502
517
  return transformUVue(code, id, jsHandler, runtimeSet);
package/dist/cli.js CHANGED
@@ -4,10 +4,10 @@ var _chunkOXASK55Qjs = require('./chunk-OXASK55Q.js');
4
4
 
5
5
 
6
6
 
7
- var _chunkW3JU6K3Tjs = require('./chunk-W3JU6K3T.js');
7
+ var _chunkFPDJ3BCMjs = require('./chunk-FPDJ3BCM.js');
8
8
  require('./chunk-DWAEHRHN.js');
9
- require('./chunk-C3CG4UUY.js');
10
- require('./chunk-LZ6L3UQO.js');
9
+ require('./chunk-OPTIAB5G.js');
10
+ require('./chunk-WXBFAARR.js');
11
11
  require('./chunk-UW3WHSZ5.js');
12
12
  require('./chunk-QXSBMK2W.js');
13
13
 
@@ -16,15 +16,15 @@ var _process = require('process'); var _process2 = _interopRequireDefault(_proce
16
16
  var _semver = require('semver'); var _semver2 = _interopRequireDefault(_semver);
17
17
  _process2.default.title = "node (weapp-tailwindcss)";
18
18
  var args = _process2.default.argv.slice(2);
19
- if (_semver2.default.lt(_process2.default.versions.node, _chunkW3JU6K3Tjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
19
+ if (_semver2.default.lt(_process2.default.versions.node, _chunkFPDJ3BCMjs.WEAPP_TW_REQUIRED_NODE_VERSION)) {
20
20
  _chunkOXASK55Qjs.logger.warn(
21
- `You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkW3JU6K3Tjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
21
+ `You are using Node.js ${_process2.default.versions.node}. For weapp-tailwindcss, Node.js version >= v${_chunkFPDJ3BCMjs.WEAPP_TW_REQUIRED_NODE_VERSION} is required.`
22
22
  );
23
23
  }
24
24
  var command = args[0];
25
25
  async function run() {
26
26
  if (command === "patch") {
27
- const ctx = _chunkW3JU6K3Tjs.getCompilerContext.call(void 0, );
27
+ const ctx = _chunkFPDJ3BCMjs.getCompilerContext.call(void 0, );
28
28
  await ctx.twPatcher.patch();
29
29
  }
30
30
  }
package/dist/cli.mjs CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  import {
5
5
  WEAPP_TW_REQUIRED_NODE_VERSION,
6
6
  getCompilerContext
7
- } from "./chunk-7TKAJ3P6.mjs";
7
+ } from "./chunk-JYCQWWYU.mjs";
8
8
  import "./chunk-VSRDBMDB.mjs";
9
- import "./chunk-IY2OKZE6.mjs";
10
- import "./chunk-NRG7N2Q7.mjs";
9
+ import "./chunk-3ARXMTWC.mjs";
10
+ import "./chunk-KZJLIZIK.mjs";
11
11
  import "./chunk-ZNKIYZRQ.mjs";
12
12
  import "./chunk-4EUTRMUC.mjs";
13
13
 
package/dist/core.js CHANGED
@@ -1,39 +1,40 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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
- var _chunkFB5P4TRHjs = require('./chunk-FB5P4TRH.js');
4
3
 
4
+ var _chunkBUMQQPAOjs = require('./chunk-BUMQQPAO.js');
5
5
 
6
- var _chunkW3JU6K3Tjs = require('./chunk-W3JU6K3T.js');
6
+
7
+ var _chunkFPDJ3BCMjs = require('./chunk-FPDJ3BCM.js');
7
8
  require('./chunk-DWAEHRHN.js');
8
- require('./chunk-C3CG4UUY.js');
9
- require('./chunk-LZ6L3UQO.js');
9
+ require('./chunk-OPTIAB5G.js');
10
+ require('./chunk-WXBFAARR.js');
10
11
  require('./chunk-UW3WHSZ5.js');
11
12
  require('./chunk-QXSBMK2W.js');
12
13
 
13
14
  // src/core.ts
14
15
  var _shared = require('@weapp-tailwindcss/shared');
15
16
  function createContext(options = {}) {
16
- const opts = _chunkW3JU6K3Tjs.getCompilerContext.call(void 0, options);
17
+ const opts = _chunkFPDJ3BCMjs.getCompilerContext.call(void 0, options);
17
18
  const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
18
19
  let runtimeSet = /* @__PURE__ */ new Set();
19
- const patchPromise = Promise.resolve(twPatcher.patch());
20
+ const patchPromise = _chunkBUMQQPAOjs.createTailwindPatchPromise.call(void 0, twPatcher);
20
21
  async function transformWxss(rawCss, options2) {
21
22
  await patchPromise;
22
23
  const result = await styleHandler(rawCss, _shared.defuOverrideArray.call(void 0, options2, {
23
24
  isMainChunk: true
24
25
  }));
25
- runtimeSet = await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
26
+ runtimeSet = await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
26
27
  return result;
27
28
  }
28
29
  async function transformJs(rawJs, options2 = {}) {
29
30
  await patchPromise;
30
- runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
31
+ runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
31
32
  return await jsHandler(rawJs, runtimeSet, options2);
32
33
  }
33
34
  async function transformWxml(rawWxml, options2) {
34
35
  await patchPromise;
35
36
  if (!_optionalChain([options2, 'optionalAccess', _ => _.runtimeSet]) && runtimeSet.size === 0) {
36
- runtimeSet = await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
37
+ runtimeSet = await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
37
38
  }
38
39
  return templateHandler(rawWxml, _shared.defuOverrideArray.call(void 0, options2, {
39
40
  runtimeSet
package/dist/core.mjs CHANGED
@@ -1,12 +1,13 @@
1
1
  import {
2
- collectRuntimeClassSet
3
- } from "./chunk-YPBRGP6K.mjs";
2
+ collectRuntimeClassSet,
3
+ createTailwindPatchPromise
4
+ } from "./chunk-667CYXAH.mjs";
4
5
  import {
5
6
  getCompilerContext
6
- } from "./chunk-7TKAJ3P6.mjs";
7
+ } from "./chunk-JYCQWWYU.mjs";
7
8
  import "./chunk-VSRDBMDB.mjs";
8
- import "./chunk-IY2OKZE6.mjs";
9
- import "./chunk-NRG7N2Q7.mjs";
9
+ import "./chunk-3ARXMTWC.mjs";
10
+ import "./chunk-KZJLIZIK.mjs";
10
11
  import "./chunk-ZNKIYZRQ.mjs";
11
12
  import "./chunk-4EUTRMUC.mjs";
12
13
 
@@ -16,24 +17,24 @@ function createContext(options = {}) {
16
17
  const opts = getCompilerContext(options);
17
18
  const { templateHandler, styleHandler, jsHandler, twPatcher } = opts;
18
19
  let runtimeSet = /* @__PURE__ */ new Set();
19
- const patchPromise = Promise.resolve(twPatcher.patch());
20
+ const patchPromise = createTailwindPatchPromise(twPatcher);
20
21
  async function transformWxss(rawCss, options2) {
21
22
  await patchPromise;
22
23
  const result = await styleHandler(rawCss, defuOverrideArray(options2, {
23
24
  isMainChunk: true
24
25
  }));
25
- runtimeSet = await collectRuntimeClassSet(twPatcher);
26
+ runtimeSet = await collectRuntimeClassSet(twPatcher, { force: true });
26
27
  return result;
27
28
  }
28
29
  async function transformJs(rawJs, options2 = {}) {
29
30
  await patchPromise;
30
- runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await collectRuntimeClassSet(twPatcher);
31
+ runtimeSet = options2 && options2.runtimeSet ? options2.runtimeSet : await collectRuntimeClassSet(twPatcher, { force: true });
31
32
  return await jsHandler(rawJs, runtimeSet, options2);
32
33
  }
33
34
  async function transformWxml(rawWxml, options2) {
34
35
  await patchPromise;
35
36
  if (!options2?.runtimeSet && runtimeSet.size === 0) {
36
- runtimeSet = await collectRuntimeClassSet(twPatcher);
37
+ runtimeSet = await collectRuntimeClassSet(twPatcher, { force: true });
37
38
  }
38
39
  return templateHandler(rawWxml, defuOverrideArray(options2, {
39
40
  runtimeSet
package/dist/defaults.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkLZ6L3UQOjs = require('./chunk-LZ6L3UQO.js');
3
+ var _chunkWXBFAARRjs = require('./chunk-WXBFAARR.js');
4
4
  require('./chunk-UW3WHSZ5.js');
5
5
  require('./chunk-QXSBMK2W.js');
6
6
 
7
7
 
8
- exports.getDefaultOptions = _chunkLZ6L3UQOjs.getDefaultOptions;
8
+ exports.getDefaultOptions = _chunkWXBFAARRjs.getDefaultOptions;
package/dist/defaults.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getDefaultOptions
3
- } from "./chunk-NRG7N2Q7.mjs";
3
+ } from "./chunk-KZJLIZIK.mjs";
4
4
  import "./chunk-ZNKIYZRQ.mjs";
5
5
  import "./chunk-4EUTRMUC.mjs";
6
6
  export {
package/dist/gulp.js CHANGED
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQ5TPAJI4js = require('./chunk-Q5TPAJI4.js');
3
+ var _chunk2SI3KT2Hjs = require('./chunk-2SI3KT2H.js');
4
4
  require('./chunk-LTJQUORK.js');
5
- require('./chunk-FB5P4TRH.js');
6
- require('./chunk-W3JU6K3T.js');
5
+ require('./chunk-BUMQQPAO.js');
6
+ require('./chunk-FPDJ3BCM.js');
7
7
  require('./chunk-DWAEHRHN.js');
8
- require('./chunk-C3CG4UUY.js');
9
- require('./chunk-LZ6L3UQO.js');
8
+ require('./chunk-OPTIAB5G.js');
9
+ require('./chunk-WXBFAARR.js');
10
10
  require('./chunk-UW3WHSZ5.js');
11
11
  require('./chunk-QXSBMK2W.js');
12
12
 
13
13
 
14
- exports.createPlugins = _chunkQ5TPAJI4js.createPlugins;
14
+ exports.createPlugins = _chunk2SI3KT2Hjs.createPlugins;