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
package/dist/gulp.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createPlugins
3
- } from "./chunk-BTOCLUJ4.mjs";
3
+ } from "./chunk-Q6PLZCM6.mjs";
4
4
  import "./chunk-RRHPTTCP.mjs";
5
- import "./chunk-YPBRGP6K.mjs";
6
- import "./chunk-7TKAJ3P6.mjs";
5
+ import "./chunk-667CYXAH.mjs";
6
+ import "./chunk-JYCQWWYU.mjs";
7
7
  import "./chunk-VSRDBMDB.mjs";
8
- import "./chunk-IY2OKZE6.mjs";
9
- import "./chunk-NRG7N2Q7.mjs";
8
+ import "./chunk-3ARXMTWC.mjs";
9
+ import "./chunk-KZJLIZIK.mjs";
10
10
  import "./chunk-ZNKIYZRQ.mjs";
11
11
  import "./chunk-4EUTRMUC.mjs";
12
12
  export {
package/dist/index.js CHANGED
@@ -1,25 +1,25 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-O2IOQ3BD.js');
2
2
 
3
3
 
4
- var _chunkCCMDCC3Njs = require('./chunk-CCMDCC3N.js');
4
+ var _chunkQZRXYCOQjs = require('./chunk-QZRXYCOQ.js');
5
5
  require('./chunk-6GP37C26.js');
6
6
 
7
7
 
8
- var _chunkQ5TPAJI4js = require('./chunk-Q5TPAJI4.js');
8
+ var _chunk2SI3KT2Hjs = require('./chunk-2SI3KT2H.js');
9
9
 
10
10
 
11
- var _chunkBAXZHBSUjs = require('./chunk-BAXZHBSU.js');
12
- require('./chunk-WVKK6TBL.js');
11
+ var _chunkGNWJEIZZjs = require('./chunk-GNWJEIZZ.js');
12
+ require('./chunk-W7BVY5S5.js');
13
13
  require('./chunk-LTJQUORK.js');
14
- require('./chunk-FB5P4TRH.js');
15
- require('./chunk-W3JU6K3T.js');
14
+ require('./chunk-BUMQQPAO.js');
15
+ require('./chunk-FPDJ3BCM.js');
16
16
  require('./chunk-DWAEHRHN.js');
17
- require('./chunk-C3CG4UUY.js');
18
- require('./chunk-LZ6L3UQO.js');
17
+ require('./chunk-OPTIAB5G.js');
18
+ require('./chunk-WXBFAARR.js');
19
19
  require('./chunk-UW3WHSZ5.js');
20
20
  require('./chunk-QXSBMK2W.js');
21
21
 
22
22
 
23
23
 
24
24
 
25
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkBAXZHBSUjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkCCMDCC3Njs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkQ5TPAJI4js.createPlugins;
25
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkGNWJEIZZjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkQZRXYCOQjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunk2SI3KT2Hjs.createPlugins;
package/dist/index.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  import "./chunk-YAN7TO2B.mjs";
2
2
  import {
3
3
  UnifiedWebpackPluginV5
4
- } from "./chunk-D7SF52F6.mjs";
4
+ } from "./chunk-5BW6X6AJ.mjs";
5
5
  import "./chunk-2F7HOQQY.mjs";
6
6
  import {
7
7
  createPlugins
8
- } from "./chunk-BTOCLUJ4.mjs";
8
+ } from "./chunk-Q6PLZCM6.mjs";
9
9
  import {
10
10
  UnifiedViteWeappTailwindcssPlugin
11
- } from "./chunk-KSXOBEXQ.mjs";
12
- import "./chunk-34T2BFTJ.mjs";
11
+ } from "./chunk-Z2H7M33Z.mjs";
12
+ import "./chunk-KZUIVLPP.mjs";
13
13
  import "./chunk-RRHPTTCP.mjs";
14
- import "./chunk-YPBRGP6K.mjs";
15
- import "./chunk-7TKAJ3P6.mjs";
14
+ import "./chunk-667CYXAH.mjs";
15
+ import "./chunk-JYCQWWYU.mjs";
16
16
  import "./chunk-VSRDBMDB.mjs";
17
- import "./chunk-IY2OKZE6.mjs";
18
- import "./chunk-NRG7N2Q7.mjs";
17
+ import "./chunk-3ARXMTWC.mjs";
18
+ import "./chunk-KZJLIZIK.mjs";
19
19
  import "./chunk-ZNKIYZRQ.mjs";
20
20
  import "./chunk-4EUTRMUC.mjs";
21
21
  export {
package/dist/presets.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var _chunkOXASK55Qjs = require('./chunk-OXASK55Q.js');
4
4
 
5
5
 
6
- var _chunkC3CG4UUYjs = require('./chunk-C3CG4UUY.js');
6
+ var _chunkOPTIAB5Gjs = require('./chunk-OPTIAB5G.js');
7
7
 
8
8
 
9
9
  var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
@@ -56,7 +56,7 @@ function toCssEntries(entries) {
56
56
  return Array.isArray(entries) ? entries : [entries];
57
57
  }
58
58
  function hbuilderx(options = {}) {
59
- const baseDir = _chunkC3CG4UUYjs.resolveTailwindcssBasedir.call(void 0, options.base);
59
+ const baseDir = _chunkOPTIAB5Gjs.resolveTailwindcssBasedir.call(void 0, options.base);
60
60
  const cssEntries = toCssEntries(options.cssEntries);
61
61
  const tailwindConfig = {
62
62
  v2: {
package/dist/presets.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-PMF2CCKK.mjs";
4
4
  import {
5
5
  resolveTailwindcssBasedir
6
- } from "./chunk-IY2OKZE6.mjs";
6
+ } from "./chunk-3ARXMTWC.mjs";
7
7
  import {
8
8
  defuOverrideArray
9
9
  } from "./chunk-ZNKIYZRQ.mjs";
package/dist/types.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ParserOptions, ParseError } from '@babel/parser';
2
- import { CssPreflightOptions, CssCalcOptions, Rem2rpxOptions, Px2rpxOptions, PresetEnvOptions, LoadedPostcssOptions, CustomRuleCallback, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
2
+ import { CssPreflightOptions, CssCalcOptions, Rem2rpxOptions, Px2rpxOptions, PresetEnvOptions, LoadedPostcssOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
3
3
  export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
4
4
  import { SourceMap } from 'magic-string';
5
5
  import { Result, Root, Document } from 'postcss';
@@ -511,25 +511,6 @@ interface UserDefinedOptions {
511
511
  */
512
512
  logLevel?: 'info' | 'warn' | 'error' | 'silent';
513
513
  }
514
- interface UserDefinedOptions {
515
- /**
516
- * 选择用于解析 JS 的 AST 工具。
517
- *
518
- * @group 4.即将废弃配置
519
- * @remarks
520
- * 默认使用 `babel`,安装 `@ast-grep/napi` 并设置为 `ast-grep` 可获得更快速度。
521
- * :::danger
522
- * 此配置将在 `5.x` 版本移除,后续仅保留 `babel` 实现。
523
- * :::
524
- */
525
- jsAstTool?: 'babel' | 'ast-grep';
526
- /**
527
- * 自定义 PostCSS 规则的处理回调。
528
- *
529
- * @group 4.即将废弃配置
530
- */
531
- customRuleCallback?: CustomRuleCallback;
532
- }
533
514
 
534
515
  type ItemOrItemArray<T> = T | T[];
535
516
 
@@ -628,7 +609,7 @@ type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCust
628
609
  cache: ICreateCacheReturnType;
629
610
  twPatcher: TailwindcssPatcherLike;
630
611
  }>;
631
- type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'customRuleCallback' | 'disabled'>;
612
+ type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'disabled'>;
632
613
  interface IBaseWebpackPlugin {
633
614
  options: InternalUserDefinedOptions;
634
615
  appType?: AppType;
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ParserOptions, ParseError } from '@babel/parser';
2
- import { CssPreflightOptions, CssCalcOptions, Rem2rpxOptions, Px2rpxOptions, PresetEnvOptions, LoadedPostcssOptions, CustomRuleCallback, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
2
+ import { CssPreflightOptions, CssCalcOptions, Rem2rpxOptions, Px2rpxOptions, PresetEnvOptions, LoadedPostcssOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
3
3
  export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss';
4
4
  import { SourceMap } from 'magic-string';
5
5
  import { Result, Root, Document } from 'postcss';
@@ -511,25 +511,6 @@ interface UserDefinedOptions {
511
511
  */
512
512
  logLevel?: 'info' | 'warn' | 'error' | 'silent';
513
513
  }
514
- interface UserDefinedOptions {
515
- /**
516
- * 选择用于解析 JS 的 AST 工具。
517
- *
518
- * @group 4.即将废弃配置
519
- * @remarks
520
- * 默认使用 `babel`,安装 `@ast-grep/napi` 并设置为 `ast-grep` 可获得更快速度。
521
- * :::danger
522
- * 此配置将在 `5.x` 版本移除,后续仅保留 `babel` 实现。
523
- * :::
524
- */
525
- jsAstTool?: 'babel' | 'ast-grep';
526
- /**
527
- * 自定义 PostCSS 规则的处理回调。
528
- *
529
- * @group 4.即将废弃配置
530
- */
531
- customRuleCallback?: CustomRuleCallback;
532
- }
533
514
 
534
515
  type ItemOrItemArray<T> = T | T[];
535
516
 
@@ -628,7 +609,7 @@ type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCust
628
609
  cache: ICreateCacheReturnType;
629
610
  twPatcher: TailwindcssPatcherLike;
630
611
  }>;
631
- type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'customRuleCallback' | 'disabled'>;
612
+ type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'disabled'>;
632
613
  interface IBaseWebpackPlugin {
633
614
  options: InternalUserDefinedOptions;
634
615
  appType?: AppType;
package/dist/vite.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkBAXZHBSUjs = require('./chunk-BAXZHBSU.js');
4
- require('./chunk-WVKK6TBL.js');
3
+ var _chunkGNWJEIZZjs = require('./chunk-GNWJEIZZ.js');
4
+ require('./chunk-W7BVY5S5.js');
5
5
  require('./chunk-LTJQUORK.js');
6
- require('./chunk-FB5P4TRH.js');
7
- require('./chunk-W3JU6K3T.js');
6
+ require('./chunk-BUMQQPAO.js');
7
+ 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
 
14
14
 
15
- exports.UnifiedViteWeappTailwindcssPlugin = _chunkBAXZHBSUjs.UnifiedViteWeappTailwindcssPlugin;
15
+ exports.UnifiedViteWeappTailwindcssPlugin = _chunkGNWJEIZZjs.UnifiedViteWeappTailwindcssPlugin;
package/dist/vite.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  UnifiedViteWeappTailwindcssPlugin
3
- } from "./chunk-KSXOBEXQ.mjs";
4
- import "./chunk-34T2BFTJ.mjs";
3
+ } from "./chunk-Z2H7M33Z.mjs";
4
+ import "./chunk-KZUIVLPP.mjs";
5
5
  import "./chunk-RRHPTTCP.mjs";
6
- import "./chunk-YPBRGP6K.mjs";
7
- import "./chunk-7TKAJ3P6.mjs";
6
+ import "./chunk-667CYXAH.mjs";
7
+ import "./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
  export {
package/dist/webpack.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkCCMDCC3Njs = require('./chunk-CCMDCC3N.js');
3
+ var _chunkQZRXYCOQjs = require('./chunk-QZRXYCOQ.js');
4
4
  require('./chunk-6GP37C26.js');
5
- require('./chunk-WVKK6TBL.js');
5
+ require('./chunk-W7BVY5S5.js');
6
6
  require('./chunk-LTJQUORK.js');
7
- require('./chunk-FB5P4TRH.js');
8
- require('./chunk-W3JU6K3T.js');
7
+ require('./chunk-BUMQQPAO.js');
8
+ require('./chunk-FPDJ3BCM.js');
9
9
  require('./chunk-DWAEHRHN.js');
10
- require('./chunk-C3CG4UUY.js');
11
- require('./chunk-LZ6L3UQO.js');
10
+ require('./chunk-OPTIAB5G.js');
11
+ require('./chunk-WXBFAARR.js');
12
12
  require('./chunk-UW3WHSZ5.js');
13
13
  require('./chunk-QXSBMK2W.js');
14
14
 
15
15
 
16
- exports.UnifiedWebpackPluginV5 = _chunkCCMDCC3Njs.UnifiedWebpackPluginV5;
16
+ exports.UnifiedWebpackPluginV5 = _chunkQZRXYCOQjs.UnifiedWebpackPluginV5;
package/dist/webpack.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  UnifiedWebpackPluginV5
3
- } from "./chunk-D7SF52F6.mjs";
3
+ } from "./chunk-5BW6X6AJ.mjs";
4
4
  import "./chunk-2F7HOQQY.mjs";
5
- import "./chunk-34T2BFTJ.mjs";
5
+ import "./chunk-KZUIVLPP.mjs";
6
6
  import "./chunk-RRHPTTCP.mjs";
7
- import "./chunk-YPBRGP6K.mjs";
8
- import "./chunk-7TKAJ3P6.mjs";
7
+ import "./chunk-667CYXAH.mjs";
8
+ import "./chunk-JYCQWWYU.mjs";
9
9
  import "./chunk-VSRDBMDB.mjs";
10
- import "./chunk-IY2OKZE6.mjs";
11
- import "./chunk-NRG7N2Q7.mjs";
10
+ import "./chunk-3ARXMTWC.mjs";
11
+ import "./chunk-KZJLIZIK.mjs";
12
12
  import "./chunk-ZNKIYZRQ.mjs";
13
13
  import "./chunk-4EUTRMUC.mjs";
14
14
  export {
package/dist/webpack4.js CHANGED
@@ -4,21 +4,23 @@ 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
  require('./chunk-DWAEHRHN.js');
20
- require('./chunk-C3CG4UUY.js');
21
- require('./chunk-LZ6L3UQO.js');
22
+ require('./chunk-OPTIAB5G.js');
23
+ require('./chunk-WXBFAARR.js');
22
24
 
23
25
 
24
26
  var _chunkUW3WHSZ5js = require('./chunk-UW3WHSZ5.js');
@@ -29,10 +31,10 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
29
31
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
30
32
  var _process = require('process'); var _process2 = _interopRequireDefault(_process);
31
33
  var _webpacksources = require('webpack-sources');
32
- var debug = _chunkFB5P4TRHjs.createDebug.call(void 0, );
34
+ var debug = _chunkBUMQQPAOjs.createDebug.call(void 0, );
33
35
  var UnifiedWebpackPluginV4 = class {
34
36
  constructor(options = {}) {
35
- this.options = _chunkW3JU6K3Tjs.getCompilerContext.call(void 0, options);
37
+ this.options = _chunkFPDJ3BCMjs.getCompilerContext.call(void 0, options);
36
38
  this.appType = this.options.appType;
37
39
  }
38
40
  apply(compiler) {
@@ -53,10 +55,10 @@ var UnifiedWebpackPluginV4 = class {
53
55
  if (disabled) {
54
56
  return;
55
57
  }
56
- const patchPromise = Promise.resolve(twPatcher.patch());
58
+ const patchPromise = _chunkBUMQQPAOjs.createTailwindPatchPromise.call(void 0, twPatcher);
57
59
  async function getClassSetInLoader() {
58
60
  await patchPromise;
59
- await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
61
+ await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
60
62
  }
61
63
  onLoad();
62
64
  const loader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-loader.js")));
@@ -69,8 +71,8 @@ var UnifiedWebpackPluginV4 = class {
69
71
  ident: null,
70
72
  type: null
71
73
  };
72
- compiler.hooks.compilation.tap(_chunkW3JU6K3Tjs.pluginName, (compilation) => {
73
- compilation.hooks.normalModuleLoader.tap(_chunkW3JU6K3Tjs.pluginName, (_loaderContext, module) => {
74
+ compiler.hooks.compilation.tap(_chunkFPDJ3BCMjs.pluginName, (compilation) => {
75
+ compilation.hooks.normalModuleLoader.tap(_chunkFPDJ3BCMjs.pluginName, (_loaderContext, module) => {
74
76
  if (isExisted) {
75
77
  const idx = module.loaders.findIndex((x) => x.loader.includes("postcss-loader"));
76
78
  if (idx > -1) {
@@ -79,7 +81,7 @@ var UnifiedWebpackPluginV4 = class {
79
81
  }
80
82
  });
81
83
  });
82
- compiler.hooks.emit.tapPromise(_chunkW3JU6K3Tjs.pluginName, async (compilation) => {
84
+ compiler.hooks.emit.tapPromise(_chunkFPDJ3BCMjs.pluginName, async (compilation) => {
83
85
  await patchPromise;
84
86
  onStart();
85
87
  debug("start");
@@ -94,13 +96,13 @@ var UnifiedWebpackPluginV4 = class {
94
96
  const jsAssets = /* @__PURE__ */ new Map();
95
97
  for (const [file] of entries) {
96
98
  if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
97
- const absolute = _chunkWVKK6TBLjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
99
+ const absolute = _chunkW7BVY5S5js.toAbsoluteOutputPath.call(void 0, file, outputDir);
98
100
  jsAssets.set(absolute, file);
99
101
  }
100
102
  }
101
103
  const moduleGraphOptions = {
102
104
  resolve(specifier, importer) {
103
- return _chunkWVKK6TBLjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
105
+ return _chunkW7BVY5S5js.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
104
106
  },
105
107
  load: (id) => {
106
108
  const assetName = jsAssets.get(id);
@@ -143,7 +145,7 @@ var UnifiedWebpackPluginV4 = class {
143
145
  }
144
146
  };
145
147
  const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
146
- const runtimeSet = await _chunkFB5P4TRHjs.collectRuntimeClassSet.call(void 0, twPatcher);
148
+ const runtimeSet = await _chunkBUMQQPAOjs.collectRuntimeClassSet.call(void 0, twPatcher, { force: true });
147
149
  debug("get runtimeSet, class count: %d", runtimeSet.size);
148
150
  const tasks = [];
149
151
  if (Array.isArray(groupedEntries.html)) {
@@ -177,6 +179,7 @@ var UnifiedWebpackPluginV4 = class {
177
179
  );
178
180
  }
179
181
  }
182
+ const jsTaskFactories = [];
180
183
  if (Array.isArray(groupedEntries.js)) {
181
184
  for (const [file] of groupedEntries.js) {
182
185
  const cacheKey = _chunk6GP37C26js.getCacheKey.call(void 0, file);
@@ -186,36 +189,38 @@ var UnifiedWebpackPluginV4 = class {
186
189
  }
187
190
  const initialValue = assetSource.source();
188
191
  const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
189
- const absoluteFile = _chunkWVKK6TBLjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
190
- await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
191
- cache,
192
- cacheKey,
193
- rawSource: initialRawSource,
194
- applyResult(source) {
195
- compilation.updateAsset(file, source);
196
- },
197
- onCacheHit() {
198
- debug("js cache hit: %s", file);
199
- },
200
- transform: async () => {
201
- const currentAsset = compilation.assets[file];
202
- const currentValue = _optionalChain([currentAsset, 'optionalAccess', _4 => _4.source, 'call', _5 => _5()]);
203
- const currentSource = typeof currentValue === "string" ? currentValue : _nullishCoalesce(_optionalChain([currentValue, 'optionalAccess', _6 => _6.toString, 'call', _7 => _7()]), () => ( ""));
204
- const { code, linked } = await jsHandler(currentSource, runtimeSet, {
205
- filename: absoluteFile,
206
- moduleGraph: moduleGraphOptions,
207
- babelParserOptions: {
208
- sourceFilename: absoluteFile
209
- }
210
- });
211
- const source = new (0, _webpacksources.ConcatSource)(code);
212
- onUpdate(file, currentSource, code);
213
- debug("js handle: %s", file);
214
- applyLinkedResults(linked);
215
- return {
216
- result: source
217
- };
218
- }
192
+ const absoluteFile = _chunkW7BVY5S5js.toAbsoluteOutputPath.call(void 0, file, outputDir);
193
+ jsTaskFactories.push(async () => {
194
+ await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
195
+ cache,
196
+ cacheKey,
197
+ rawSource: initialRawSource,
198
+ applyResult(source) {
199
+ compilation.updateAsset(file, source);
200
+ },
201
+ onCacheHit() {
202
+ debug("js cache hit: %s", file);
203
+ },
204
+ transform: async () => {
205
+ const currentAsset = compilation.assets[file];
206
+ const currentValue = _optionalChain([currentAsset, 'optionalAccess', _4 => _4.source, 'call', _5 => _5()]);
207
+ const currentSource = typeof currentValue === "string" ? currentValue : _nullishCoalesce(_optionalChain([currentValue, 'optionalAccess', _6 => _6.toString, 'call', _7 => _7()]), () => ( ""));
208
+ const { code, linked } = await jsHandler(currentSource, runtimeSet, {
209
+ filename: absoluteFile,
210
+ moduleGraph: moduleGraphOptions,
211
+ babelParserOptions: {
212
+ sourceFilename: absoluteFile
213
+ }
214
+ });
215
+ const source = new (0, _webpacksources.ConcatSource)(code);
216
+ onUpdate(file, currentSource, code);
217
+ debug("js handle: %s", file);
218
+ applyLinkedResults(linked);
219
+ return {
220
+ result: source
221
+ };
222
+ }
223
+ });
219
224
  });
220
225
  }
221
226
  }
@@ -257,6 +262,7 @@ var UnifiedWebpackPluginV4 = class {
257
262
  );
258
263
  }
259
264
  }
265
+ _chunkW7BVY5S5js.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
260
266
  await Promise.all(tasks);
261
267
  debug("end");
262
268
  onEnd();
package/dist/webpack4.mjs CHANGED
@@ -2,23 +2,25 @@ import {
2
2
  getCacheKey
3
3
  } from "./chunk-2F7HOQQY.mjs";
4
4
  import {
5
+ pushConcurrentTaskFactories,
5
6
  resolveOutputSpecifier,
6
7
  toAbsoluteOutputPath
7
- } from "./chunk-34T2BFTJ.mjs";
8
+ } from "./chunk-KZUIVLPP.mjs";
8
9
  import {
9
10
  processCachedTask
10
11
  } from "./chunk-RRHPTTCP.mjs";
11
12
  import {
12
13
  collectRuntimeClassSet,
13
- createDebug
14
- } from "./chunk-YPBRGP6K.mjs";
14
+ createDebug,
15
+ createTailwindPatchPromise
16
+ } from "./chunk-667CYXAH.mjs";
15
17
  import {
16
18
  getCompilerContext,
17
19
  pluginName
18
- } from "./chunk-7TKAJ3P6.mjs";
20
+ } from "./chunk-JYCQWWYU.mjs";
19
21
  import "./chunk-VSRDBMDB.mjs";
20
- import "./chunk-IY2OKZE6.mjs";
21
- import "./chunk-NRG7N2Q7.mjs";
22
+ import "./chunk-3ARXMTWC.mjs";
23
+ import "./chunk-KZJLIZIK.mjs";
22
24
  import {
23
25
  getGroupedEntries
24
26
  } from "./chunk-ZNKIYZRQ.mjs";
@@ -55,10 +57,10 @@ var UnifiedWebpackPluginV4 = class {
55
57
  if (disabled) {
56
58
  return;
57
59
  }
58
- const patchPromise = Promise.resolve(twPatcher.patch());
60
+ const patchPromise = createTailwindPatchPromise(twPatcher);
59
61
  async function getClassSetInLoader() {
60
62
  await patchPromise;
61
- await collectRuntimeClassSet(twPatcher);
63
+ await collectRuntimeClassSet(twPatcher, { force: true });
62
64
  }
63
65
  onLoad();
64
66
  const loader = runtimeLoaderPath ?? path.resolve(__dirname, "./weapp-tw-runtime-loader.js");
@@ -145,7 +147,7 @@ var UnifiedWebpackPluginV4 = class {
145
147
  }
146
148
  };
147
149
  const groupedEntries = getGroupedEntries(entries, this.options);
148
- const runtimeSet = await collectRuntimeClassSet(twPatcher);
150
+ const runtimeSet = await collectRuntimeClassSet(twPatcher, { force: true });
149
151
  debug("get runtimeSet, class count: %d", runtimeSet.size);
150
152
  const tasks = [];
151
153
  if (Array.isArray(groupedEntries.html)) {
@@ -179,6 +181,7 @@ var UnifiedWebpackPluginV4 = class {
179
181
  );
180
182
  }
181
183
  }
184
+ const jsTaskFactories = [];
182
185
  if (Array.isArray(groupedEntries.js)) {
183
186
  for (const [file] of groupedEntries.js) {
184
187
  const cacheKey = getCacheKey(file);
@@ -189,35 +192,37 @@ var UnifiedWebpackPluginV4 = class {
189
192
  const initialValue = assetSource.source();
190
193
  const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
191
194
  const absoluteFile = toAbsoluteOutputPath(file, outputDir);
192
- await processCachedTask({
193
- cache,
194
- cacheKey,
195
- rawSource: initialRawSource,
196
- applyResult(source) {
197
- compilation.updateAsset(file, source);
198
- },
199
- onCacheHit() {
200
- debug("js cache hit: %s", file);
201
- },
202
- transform: async () => {
203
- const currentAsset = compilation.assets[file];
204
- const currentValue = currentAsset?.source();
205
- const currentSource = typeof currentValue === "string" ? currentValue : currentValue?.toString() ?? "";
206
- const { code, linked } = await jsHandler(currentSource, runtimeSet, {
207
- filename: absoluteFile,
208
- moduleGraph: moduleGraphOptions,
209
- babelParserOptions: {
210
- sourceFilename: absoluteFile
211
- }
212
- });
213
- const source = new ConcatSource(code);
214
- onUpdate(file, currentSource, code);
215
- debug("js handle: %s", file);
216
- applyLinkedResults(linked);
217
- return {
218
- result: source
219
- };
220
- }
195
+ jsTaskFactories.push(async () => {
196
+ await processCachedTask({
197
+ cache,
198
+ cacheKey,
199
+ rawSource: initialRawSource,
200
+ applyResult(source) {
201
+ compilation.updateAsset(file, source);
202
+ },
203
+ onCacheHit() {
204
+ debug("js cache hit: %s", file);
205
+ },
206
+ transform: async () => {
207
+ const currentAsset = compilation.assets[file];
208
+ const currentValue = currentAsset?.source();
209
+ const currentSource = typeof currentValue === "string" ? currentValue : currentValue?.toString() ?? "";
210
+ const { code, linked } = await jsHandler(currentSource, runtimeSet, {
211
+ filename: absoluteFile,
212
+ moduleGraph: moduleGraphOptions,
213
+ babelParserOptions: {
214
+ sourceFilename: absoluteFile
215
+ }
216
+ });
217
+ const source = new ConcatSource(code);
218
+ onUpdate(file, currentSource, code);
219
+ debug("js handle: %s", file);
220
+ applyLinkedResults(linked);
221
+ return {
222
+ result: source
223
+ };
224
+ }
225
+ });
221
226
  });
222
227
  }
223
228
  }
@@ -259,6 +264,7 @@ var UnifiedWebpackPluginV4 = class {
259
264
  );
260
265
  }
261
266
  }
267
+ pushConcurrentTaskFactories(tasks, jsTaskFactories);
262
268
  await Promise.all(tasks);
263
269
  debug("end");
264
270
  onEnd();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weapp-tailwindcss",
3
- "version": "4.7.0",
3
+ "version": "4.7.2",
4
4
  "description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -175,9 +175,9 @@
175
175
  "semver": "~7.7.3",
176
176
  "tailwindcss-patch": "^8.2.1",
177
177
  "webpack-sources": "3.3.3",
178
- "@weapp-tailwindcss/postcss": "2.0.0",
179
- "@weapp-tailwindcss/shared": "1.1.0",
180
- "@weapp-tailwindcss/logger": "1.1.0"
178
+ "@weapp-tailwindcss/logger": "1.1.0",
179
+ "@weapp-tailwindcss/postcss": "2.0.1",
180
+ "@weapp-tailwindcss/shared": "1.1.0"
181
181
  },
182
182
  "scripts": {
183
183
  "dev": "tsup --watch --sourcemap",