weapp-tailwindcss 4.8.13 → 4.8.15
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-HXYNNE6Q.mjs → chunk-3SKEY32E.mjs} +18 -119
- package/dist/{chunk-JSV4IYLL.mjs → chunk-4ZJEFTPC.mjs} +2 -2
- package/dist/{chunk-CSDB62E5.mjs → chunk-7LRI7LJO.mjs} +14 -12
- package/dist/{chunk-BLTNVVBH.js → chunk-7UBHTADV.js} +1 -1
- package/dist/chunk-DGL3SP2H.js +251 -0
- package/dist/{chunk-7MREZHFO.mjs → chunk-FQX7YIN5.mjs} +1 -1
- package/dist/{chunk-G4UFQ3CK.js → chunk-H4BVDT5Q.js} +7 -7
- package/dist/{chunk-3S6VRBOM.js → chunk-I7VIMPUB.js} +3 -3
- package/dist/{chunk-4E2U7YIQ.mjs → chunk-K3XO75VC.mjs} +68 -48
- package/dist/{chunk-Z6E242OH.js → chunk-ORSWL3MI.js} +18 -119
- package/dist/{chunk-U6O2TOS7.js → chunk-PIVX3SXU.js} +84 -64
- package/dist/{chunk-WHELJMZL.mjs → chunk-QYYQDG6A.mjs} +1 -1
- package/dist/{chunk-B7643BFR.js → chunk-W3CX5DGR.js} +34 -32
- package/dist/chunk-XRYCPSQC.mjs +251 -0
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +1 -1
- package/dist/core.js +8 -8
- package/dist/core.mjs +2 -2
- package/dist/gulp.js +4 -4
- package/dist/gulp.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/types.d.mts +24 -2
- package/dist/types.d.ts +24 -2
- package/dist/vite.js +5 -5
- package/dist/vite.mjs +4 -4
- package/dist/weapp-tw-css-import-rewrite-loader.js +2 -18
- package/dist/weapp-tw-runtime-classset-loader.js +1 -3
- package/dist/webpack.js +6 -6
- package/dist/webpack.mjs +5 -5
- package/dist/webpack4.js +35 -33
- package/dist/webpack4.mjs +14 -12
- package/package.json +3 -3
- package/dist/chunk-BYXBJQAS.js +0 -1
- package/dist/chunk-OPA2EYQV.mjs +0 -136
- package/dist/chunk-XX7SUSE7.js +0 -136
package/dist/index.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkW3CX5DGRjs = require('./chunk-W3CX5DGR.js');
|
|
6
|
+
require('./chunk-DGL3SP2H.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkH4BVDT5Qjs = require('./chunk-H4BVDT5Q.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkPIVX3SXUjs = require('./chunk-PIVX3SXU.js');
|
|
13
|
+
require('./chunk-ORSWL3MI.js');
|
|
14
14
|
require('./chunk-LTJQUORK.js');
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-I7VIMPUB.js');
|
|
16
|
+
require('./chunk-7UBHTADV.js');
|
|
17
17
|
require('./chunk-J4MI4EJO.js');
|
|
18
18
|
require('./chunk-3URI7W6X.js');
|
|
19
19
|
require('./chunk-UW3WHSZ5.js');
|
|
@@ -23,4 +23,4 @@ require('./chunk-MB4BR57E.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
26
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkPIVX3SXUjs.UnifiedViteWeappTailwindcssPlugin; exports.UnifiedWebpackPluginV5 = _chunkW3CX5DGRjs.UnifiedWebpackPluginV5; exports.createPlugins = _chunkH4BVDT5Qjs.createPlugins; exports.weappTailwindcssPackageDir = _chunkW3CX5DGRjs.weappTailwindcssPackageDir;
|
package/dist/index.mjs
CHANGED
|
@@ -2,18 +2,18 @@ import "./chunk-YAN7TO2B.mjs";
|
|
|
2
2
|
import {
|
|
3
3
|
UnifiedWebpackPluginV5,
|
|
4
4
|
weappTailwindcssPackageDir
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-7LRI7LJO.mjs";
|
|
6
|
+
import "./chunk-XRYCPSQC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
createPlugins
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4ZJEFTPC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
UnifiedViteWeappTailwindcssPlugin
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-K3XO75VC.mjs";
|
|
13
|
+
import "./chunk-3SKEY32E.mjs";
|
|
14
14
|
import "./chunk-RRHPTTCP.mjs";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-FQX7YIN5.mjs";
|
|
16
|
+
import "./chunk-QYYQDG6A.mjs";
|
|
17
17
|
import "./chunk-3VIPMWAG.mjs";
|
|
18
18
|
import "./chunk-QF65JGNW.mjs";
|
|
19
19
|
import "./chunk-ZNKIYZRQ.mjs";
|
package/dist/types.d.mts
CHANGED
|
@@ -41,6 +41,28 @@ interface ICreateCacheReturnType {
|
|
|
41
41
|
process: <T extends CacheValue>(options: CacheProcessOptions<T>) => Promise<T>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* 禁用插件功能的细粒度选项。
|
|
46
|
+
*
|
|
47
|
+
* @group 0.重要配置
|
|
48
|
+
* @since ^4.2.0
|
|
49
|
+
* @remarks
|
|
50
|
+
* 适用于需要仅关闭部分行为(例如主插件流程),但保留其他预处理能力(如 Tailwind v4 的 `@import "tailwindcss"` 重写)。
|
|
51
|
+
*/
|
|
52
|
+
interface DisabledOptions {
|
|
53
|
+
/**
|
|
54
|
+
* 禁用主插件流程,等同于 `disabled: true`。
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
plugin?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 禁用对 `@import "tailwindcss"` 的预处理重写。
|
|
61
|
+
*
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
rewriteCssImports?: boolean;
|
|
65
|
+
}
|
|
44
66
|
interface UserDefinedOptions {
|
|
45
67
|
/**
|
|
46
68
|
* 是否禁用此插件。
|
|
@@ -64,7 +86,7 @@ interface UserDefinedOptions {
|
|
|
64
86
|
* })
|
|
65
87
|
* ```
|
|
66
88
|
*/
|
|
67
|
-
disabled?: boolean;
|
|
89
|
+
disabled?: boolean | DisabledOptions;
|
|
68
90
|
/**
|
|
69
91
|
* 自定义 `wxml` 标签属性的转换规则。
|
|
70
92
|
*
|
|
@@ -670,4 +692,4 @@ interface JsModuleGraphOptions {
|
|
|
670
692
|
maxDepth?: number;
|
|
671
693
|
}
|
|
672
694
|
|
|
673
|
-
export type { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions };
|
|
695
|
+
export type { AppType, CreateJsHandlerOptions, DisabledOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions };
|
package/dist/types.d.ts
CHANGED
|
@@ -41,6 +41,28 @@ interface ICreateCacheReturnType {
|
|
|
41
41
|
process: <T extends CacheValue>(options: CacheProcessOptions<T>) => Promise<T>;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* 禁用插件功能的细粒度选项。
|
|
46
|
+
*
|
|
47
|
+
* @group 0.重要配置
|
|
48
|
+
* @since ^4.2.0
|
|
49
|
+
* @remarks
|
|
50
|
+
* 适用于需要仅关闭部分行为(例如主插件流程),但保留其他预处理能力(如 Tailwind v4 的 `@import "tailwindcss"` 重写)。
|
|
51
|
+
*/
|
|
52
|
+
interface DisabledOptions {
|
|
53
|
+
/**
|
|
54
|
+
* 禁用主插件流程,等同于 `disabled: true`。
|
|
55
|
+
*
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
plugin?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 禁用对 `@import "tailwindcss"` 的预处理重写。
|
|
61
|
+
*
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
rewriteCssImports?: boolean;
|
|
65
|
+
}
|
|
44
66
|
interface UserDefinedOptions {
|
|
45
67
|
/**
|
|
46
68
|
* 是否禁用此插件。
|
|
@@ -64,7 +86,7 @@ interface UserDefinedOptions {
|
|
|
64
86
|
* })
|
|
65
87
|
* ```
|
|
66
88
|
*/
|
|
67
|
-
disabled?: boolean;
|
|
89
|
+
disabled?: boolean | DisabledOptions;
|
|
68
90
|
/**
|
|
69
91
|
* 自定义 `wxml` 标签属性的转换规则。
|
|
70
92
|
*
|
|
@@ -670,4 +692,4 @@ interface JsModuleGraphOptions {
|
|
|
670
692
|
maxDepth?: number;
|
|
671
693
|
}
|
|
672
694
|
|
|
673
|
-
export type { AppType, CreateJsHandlerOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions };
|
|
695
|
+
export type { AppType, CreateJsHandlerOptions, DisabledOptions, IArbitraryValues, IBaseWebpackPlugin, ICommonReplaceOptions, ICustomAttributes, ICustomAttributesEntities, IJsHandlerOptions, ITemplateHandlerOptions, InternalPatchResult, InternalPostcssOptions, InternalUserDefinedOptions, ItemOrItemArray, JsHandler, JsHandlerResult, JsModuleGraphOptions, LinkedJsModuleResult, RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike, UserDefinedOptions };
|
package/dist/vite.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkPIVX3SXUjs = require('./chunk-PIVX3SXU.js');
|
|
4
|
+
require('./chunk-ORSWL3MI.js');
|
|
5
5
|
require('./chunk-LTJQUORK.js');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-I7VIMPUB.js');
|
|
7
|
+
require('./chunk-7UBHTADV.js');
|
|
8
8
|
require('./chunk-J4MI4EJO.js');
|
|
9
9
|
require('./chunk-3URI7W6X.js');
|
|
10
10
|
require('./chunk-UW3WHSZ5.js');
|
|
11
11
|
require('./chunk-MB4BR57E.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.UnifiedViteWeappTailwindcssPlugin =
|
|
14
|
+
exports.UnifiedViteWeappTailwindcssPlugin = _chunkPIVX3SXUjs.UnifiedViteWeappTailwindcssPlugin;
|
package/dist/vite.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedViteWeappTailwindcssPlugin
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-K3XO75VC.mjs";
|
|
4
|
+
import "./chunk-3SKEY32E.mjs";
|
|
5
5
|
import "./chunk-RRHPTTCP.mjs";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-FQX7YIN5.mjs";
|
|
7
|
+
import "./chunk-QYYQDG6A.mjs";
|
|
8
8
|
import "./chunk-3VIPMWAG.mjs";
|
|
9
9
|
import "./chunk-QF65JGNW.mjs";
|
|
10
10
|
import "./chunk-ZNKIYZRQ.mjs";
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
// src/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.ts
|
|
4
2
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
5
3
|
var _loaderutils = require('loader-utils'); var _loaderutils2 = _interopRequireDefault(_loaderutils);
|
|
6
4
|
|
|
7
5
|
// src/bundlers/shared/css-imports.ts
|
|
8
6
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
9
|
-
|
|
10
|
-
// src/shared/mpx.ts
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// src/shared/tailwindcss-css-redirect.ts
|
|
14
|
-
var _module = require('module'); var _module2 = _interopRequireDefault(_module);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// src/shared/mpx.ts
|
|
18
|
-
function isMpx(appType) {
|
|
19
|
-
return appType === "mpx";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// src/bundlers/shared/css-imports.ts
|
|
23
7
|
var tailwindcssImportRE = /^tailwindcss(?:\/.*)?$/;
|
|
24
8
|
var tailwindcssCssImportStatementRE = /(@import\s+(?:url\(\s*)?)(["'])(tailwindcss(?:\/[^"']*)?\$?)(\2\s*\)?)/gi;
|
|
25
9
|
function normalizeTailwindcssSpecifier(specifier) {
|
|
@@ -40,7 +24,7 @@ function resolveTailwindcssImport(specifier, pkgDir, options) {
|
|
|
40
24
|
if (!tailwindcssImportRE.test(normalized)) {
|
|
41
25
|
return null;
|
|
42
26
|
}
|
|
43
|
-
if (
|
|
27
|
+
if (normalized === "tailwindcss") {
|
|
44
28
|
return "weapp-tailwindcss/index.css";
|
|
45
29
|
}
|
|
46
30
|
const join = (_a = options == null ? void 0 : options.join) != null ? _a : _path2.default.join;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
// src/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.ts
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.ts
|
|
4
2
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
5
3
|
var _loaderutils = require('loader-utils'); var _loaderutils2 = _interopRequireDefault(_loaderutils);
|
|
6
4
|
var WeappTwRuntimeClassSetLoader = function(source) {
|
package/dist/webpack.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunkW3CX5DGRjs = require('./chunk-W3CX5DGR.js');
|
|
5
|
+
require('./chunk-DGL3SP2H.js');
|
|
6
|
+
require('./chunk-ORSWL3MI.js');
|
|
7
7
|
require('./chunk-LTJQUORK.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-I7VIMPUB.js');
|
|
9
|
+
require('./chunk-7UBHTADV.js');
|
|
10
10
|
require('./chunk-J4MI4EJO.js');
|
|
11
11
|
require('./chunk-3URI7W6X.js');
|
|
12
12
|
require('./chunk-UW3WHSZ5.js');
|
|
@@ -14,4 +14,4 @@ require('./chunk-MB4BR57E.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.UnifiedWebpackPluginV5 =
|
|
17
|
+
exports.UnifiedWebpackPluginV5 = _chunkW3CX5DGRjs.UnifiedWebpackPluginV5; exports.weappTailwindcssPackageDir = _chunkW3CX5DGRjs.weappTailwindcssPackageDir;
|
package/dist/webpack.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
UnifiedWebpackPluginV5,
|
|
3
3
|
weappTailwindcssPackageDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-7LRI7LJO.mjs";
|
|
5
|
+
import "./chunk-XRYCPSQC.mjs";
|
|
6
|
+
import "./chunk-3SKEY32E.mjs";
|
|
7
7
|
import "./chunk-RRHPTTCP.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-FQX7YIN5.mjs";
|
|
9
|
+
import "./chunk-QYYQDG6A.mjs";
|
|
10
10
|
import "./chunk-3VIPMWAG.mjs";
|
|
11
11
|
import "./chunk-QF65JGNW.mjs";
|
|
12
12
|
import "./chunk-ZNKIYZRQ.mjs";
|
package/dist/webpack4.js
CHANGED
|
@@ -4,31 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var _chunkXX7SUSE7js = require('./chunk-XX7SUSE7.js');
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
12
|
+
var _chunkDGL3SP2Hjs = require('./chunk-DGL3SP2H.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkORSWL3MIjs = require('./chunk-ORSWL3MI.js');
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
var _chunkLTJQUORKjs = require('./chunk-LTJQUORK.js');
|
|
22
23
|
|
|
23
24
|
|
|
24
|
-
var
|
|
25
|
+
var _chunkI7VIMPUBjs = require('./chunk-I7VIMPUB.js');
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
var
|
|
32
|
+
var _chunk7UBHTADVjs = require('./chunk-7UBHTADV.js');
|
|
32
33
|
require('./chunk-J4MI4EJO.js');
|
|
33
34
|
require('./chunk-3URI7W6X.js');
|
|
34
35
|
|
|
@@ -41,11 +42,11 @@ var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
|
41
42
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
42
43
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
43
44
|
var _webpacksources = require('webpack-sources');
|
|
44
|
-
var debug =
|
|
45
|
-
var weappTailwindcssPackageDir =
|
|
45
|
+
var debug = _chunk7UBHTADVjs.createDebug.call(void 0, );
|
|
46
|
+
var weappTailwindcssPackageDir = _chunkORSWL3MIjs.resolvePackageDir.call(void 0, "weapp-tailwindcss");
|
|
46
47
|
var UnifiedWebpackPluginV4 = class {
|
|
47
48
|
constructor(options = {}) {
|
|
48
|
-
this.options =
|
|
49
|
+
this.options = _chunk7UBHTADVjs.getCompilerContext.call(void 0, options);
|
|
49
50
|
this.appType = this.options.appType;
|
|
50
51
|
}
|
|
51
52
|
apply(compiler) {
|
|
@@ -66,21 +67,22 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
66
67
|
twPatcher: initialTwPatcher,
|
|
67
68
|
refreshTailwindcssPatcher
|
|
68
69
|
} = this.options;
|
|
69
|
-
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
70
|
+
const disabledOptions = _chunkORSWL3MIjs.resolveDisabledOptions.call(void 0, disabled);
|
|
72
71
|
const isTailwindcssV4 = (_nullishCoalesce(initialTwPatcher.majorVersion, () => ( 0))) >= 4;
|
|
73
|
-
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false;
|
|
74
|
-
const isMpxApp =
|
|
72
|
+
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
73
|
+
const isMpxApp = _chunkDGL3SP2Hjs.isMpx.call(void 0, this.appType);
|
|
75
74
|
if (shouldRewriteCssImports) {
|
|
76
|
-
|
|
75
|
+
_chunkDGL3SP2Hjs.applyTailwindcssCssImportRewrite.call(void 0, compiler, {
|
|
77
76
|
pkgDir: weappTailwindcssPackageDir,
|
|
78
77
|
enabled: true,
|
|
79
78
|
appType: this.appType
|
|
80
79
|
});
|
|
81
|
-
|
|
80
|
+
_chunkDGL3SP2Hjs.setupMpxTailwindcssRedirect.call(void 0, weappTailwindcssPackageDir, isMpxApp);
|
|
81
|
+
}
|
|
82
|
+
if (disabledOptions.plugin) {
|
|
83
|
+
return;
|
|
82
84
|
}
|
|
83
|
-
const patchRecorderState =
|
|
85
|
+
const patchRecorderState = _chunkI7VIMPUBjs.setupPatchRecorder.call(void 0, initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
84
86
|
source: "runtime",
|
|
85
87
|
cwd: _nullishCoalesce(this.options.tailwindcssBasedir, () => ( _process2.default.cwd()))
|
|
86
88
|
});
|
|
@@ -91,12 +93,12 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
91
93
|
onPatchCompleted: patchRecorderState.onPatchCompleted
|
|
92
94
|
};
|
|
93
95
|
const refreshRuntimeState = async (force) => {
|
|
94
|
-
await
|
|
96
|
+
await _chunk7UBHTADVjs.refreshTailwindRuntimeState.call(void 0, runtimeState, force);
|
|
95
97
|
};
|
|
96
98
|
async function getClassSetInLoader() {
|
|
97
99
|
await refreshRuntimeState(true);
|
|
98
100
|
await runtimeState.patchPromise;
|
|
99
|
-
await
|
|
101
|
+
await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
100
102
|
}
|
|
101
103
|
const runtimeClassSetLoader = _nullishCoalesce(runtimeLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-runtime-classset-loader.js")));
|
|
102
104
|
const runtimeCssImportRewriteLoader = shouldRewriteCssImports ? _nullishCoalesce(runtimeCssImportRewriteLoaderPath, () => ( _path2.default.resolve(__dirname, "./weapp-tw-css-import-rewrite-loader.js"))) : void 0;
|
|
@@ -109,16 +111,16 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
109
111
|
const classSetLoaderOptions = {
|
|
110
112
|
getClassSet: getClassSetInLoader
|
|
111
113
|
};
|
|
112
|
-
const { findRewriteAnchor, findClassSetAnchor } =
|
|
114
|
+
const { findRewriteAnchor, findClassSetAnchor } = _chunkDGL3SP2Hjs.createLoaderAnchorFinders.call(void 0, this.appType);
|
|
113
115
|
const cssImportRewriteLoaderOptions = runtimeLoaderRewriteOptions ? {
|
|
114
116
|
rewriteCssImports: runtimeLoaderRewriteOptions
|
|
115
117
|
} : void 0;
|
|
116
118
|
onLoad();
|
|
117
119
|
if (shouldRewriteCssImports && isMpxApp) {
|
|
118
|
-
|
|
120
|
+
_chunkDGL3SP2Hjs.ensureMpxTailwindcssAliases.call(void 0, compiler, weappTailwindcssPackageDir);
|
|
119
121
|
}
|
|
120
122
|
if (runtimeCssImportRewriteLoader && shouldRewriteCssImports && cssImportRewriteLoaderOptions && isMpxApp) {
|
|
121
|
-
|
|
123
|
+
_chunkDGL3SP2Hjs.injectMpxCssRewritePreRules.call(void 0, compiler, runtimeCssImportRewriteLoader, cssImportRewriteLoaderOptions);
|
|
122
124
|
}
|
|
123
125
|
const createRuntimeClassSetLoaderEntry = () => ({
|
|
124
126
|
loader: runtimeClassSetLoader,
|
|
@@ -137,19 +139,19 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
137
139
|
type: null
|
|
138
140
|
};
|
|
139
141
|
};
|
|
140
|
-
compiler.hooks.compilation.tap(
|
|
141
|
-
compilation.hooks.normalModuleLoader.tap(
|
|
142
|
+
compiler.hooks.compilation.tap(_chunk7UBHTADVjs.pluginName, (compilation) => {
|
|
143
|
+
compilation.hooks.normalModuleLoader.tap(_chunk7UBHTADVjs.pluginName, (_loaderContext, module) => {
|
|
142
144
|
const hasRuntimeLoader = runtimeClassSetLoaderExists || runtimeCssImportRewriteLoaderExists;
|
|
143
145
|
if (!hasRuntimeLoader) {
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
|
-
if (shouldRewriteCssImports &&
|
|
147
|
-
|
|
148
|
+
if (shouldRewriteCssImports && _chunkDGL3SP2Hjs.isMpx.call(void 0, this.appType) && typeof _loaderContext.resolve === "function") {
|
|
149
|
+
_chunkDGL3SP2Hjs.patchMpxLoaderResolve.call(void 0, _loaderContext, weappTailwindcssPackageDir, true);
|
|
148
150
|
}
|
|
149
151
|
const loaderEntries = module.loaders || [];
|
|
150
152
|
let rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
151
153
|
const classSetAnchorIdx = findClassSetAnchor(loaderEntries);
|
|
152
|
-
const isCssModule =
|
|
154
|
+
const isCssModule = _chunkDGL3SP2Hjs.isCssLikeModuleResource.call(void 0, module.resource, this.options.cssMatcher, this.appType);
|
|
153
155
|
if (_process2.default.env.WEAPP_TW_LOADER_DEBUG && isCssModule) {
|
|
154
156
|
debug("loader hook css module: %s loaders=%o anchors=%o", module.resource, loaderEntries.map((x) => x.loader), { rewriteAnchorIdx, classSetAnchorIdx });
|
|
155
157
|
}
|
|
@@ -183,7 +185,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
183
185
|
rewriteAnchorIdx = findRewriteAnchor(loaderEntries);
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
|
-
if (runtimeClassSetLoaderExists && !
|
|
188
|
+
if (runtimeClassSetLoaderExists && !_chunkDGL3SP2Hjs.hasLoaderEntry.call(void 0, loaderEntries, runtimeClassSetLoader)) {
|
|
187
189
|
const anchorIndex = findClassSetAnchor(loaderEntries);
|
|
188
190
|
if (anchorIndex === -1) {
|
|
189
191
|
anchorlessInsert(createRuntimeClassSetLoaderEntry(), "before");
|
|
@@ -194,7 +196,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
194
196
|
}
|
|
195
197
|
});
|
|
196
198
|
});
|
|
197
|
-
compiler.hooks.emit.tapPromise(
|
|
199
|
+
compiler.hooks.emit.tapPromise(_chunk7UBHTADVjs.pluginName, async (compilation) => {
|
|
198
200
|
await runtimeState.patchPromise;
|
|
199
201
|
onStart();
|
|
200
202
|
debug("start");
|
|
@@ -209,13 +211,13 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
209
211
|
const jsAssets = /* @__PURE__ */ new Map();
|
|
210
212
|
for (const [file] of entries) {
|
|
211
213
|
if (this.options.jsMatcher(file) || this.options.wxsMatcher(file)) {
|
|
212
|
-
const absolute =
|
|
214
|
+
const absolute = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
213
215
|
jsAssets.set(absolute, file);
|
|
214
216
|
}
|
|
215
217
|
}
|
|
216
218
|
const moduleGraphOptions = {
|
|
217
219
|
resolve(specifier, importer) {
|
|
218
|
-
return
|
|
220
|
+
return _chunkORSWL3MIjs.resolveOutputSpecifier.call(void 0, specifier, importer, outputDir, (candidate) => jsAssets.has(candidate));
|
|
219
221
|
},
|
|
220
222
|
load: (id) => {
|
|
221
223
|
const assetName = jsAssets.get(id);
|
|
@@ -260,7 +262,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
260
262
|
const groupedEntries = _chunkUW3WHSZ5js.getGroupedEntries.call(void 0, entries, this.options);
|
|
261
263
|
await refreshRuntimeState(true);
|
|
262
264
|
await runtimeState.patchPromise;
|
|
263
|
-
const runtimeSet = await
|
|
265
|
+
const runtimeSet = await _chunk7UBHTADVjs.collectRuntimeClassSet.call(void 0, runtimeState.twPatcher, { force: true, skipRefresh: true });
|
|
264
266
|
debug("get runtimeSet, class count: %d", runtimeSet.size);
|
|
265
267
|
const tasks = [];
|
|
266
268
|
if (Array.isArray(groupedEntries.html)) {
|
|
@@ -297,14 +299,14 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
297
299
|
const jsTaskFactories = [];
|
|
298
300
|
if (Array.isArray(groupedEntries.js)) {
|
|
299
301
|
for (const [file] of groupedEntries.js) {
|
|
300
|
-
const cacheKey =
|
|
302
|
+
const cacheKey = _chunkDGL3SP2Hjs.getCacheKey.call(void 0, file);
|
|
301
303
|
const assetSource = compilation.assets[file];
|
|
302
304
|
if (!assetSource) {
|
|
303
305
|
continue;
|
|
304
306
|
}
|
|
305
307
|
const initialValue = assetSource.source();
|
|
306
308
|
const initialRawSource = typeof initialValue === "string" ? initialValue : initialValue.toString();
|
|
307
|
-
const absoluteFile =
|
|
309
|
+
const absoluteFile = _chunkORSWL3MIjs.toAbsoluteOutputPath.call(void 0, file, outputDir);
|
|
308
310
|
jsTaskFactories.push(async () => {
|
|
309
311
|
await _chunkLTJQUORKjs.processCachedTask.call(void 0, {
|
|
310
312
|
cache,
|
|
@@ -377,7 +379,7 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
377
379
|
);
|
|
378
380
|
}
|
|
379
381
|
}
|
|
380
|
-
|
|
382
|
+
_chunkORSWL3MIjs.pushConcurrentTaskFactories.call(void 0, tasks, jsTaskFactories);
|
|
381
383
|
await Promise.all(tasks);
|
|
382
384
|
debug("end");
|
|
383
385
|
onEnd();
|
package/dist/webpack4.mjs
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyTailwindcssCssImportRewrite,
|
|
3
3
|
createLoaderAnchorFinders,
|
|
4
|
+
ensureMpxTailwindcssAliases,
|
|
4
5
|
getCacheKey,
|
|
5
6
|
hasLoaderEntry,
|
|
6
|
-
isCssLikeModuleResource
|
|
7
|
-
} from "./chunk-OPA2EYQV.mjs";
|
|
8
|
-
import {
|
|
9
|
-
ensureMpxTailwindcssAliases,
|
|
10
7
|
injectMpxCssRewritePreRules,
|
|
8
|
+
isCssLikeModuleResource,
|
|
11
9
|
isMpx,
|
|
12
10
|
patchMpxLoaderResolve,
|
|
11
|
+
setupMpxTailwindcssRedirect
|
|
12
|
+
} from "./chunk-XRYCPSQC.mjs";
|
|
13
|
+
import {
|
|
13
14
|
pushConcurrentTaskFactories,
|
|
15
|
+
resolveDisabledOptions,
|
|
14
16
|
resolveOutputSpecifier,
|
|
15
17
|
resolvePackageDir,
|
|
16
|
-
setupMpxTailwindcssRedirect,
|
|
17
18
|
toAbsoluteOutputPath
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3SKEY32E.mjs";
|
|
19
20
|
import {
|
|
20
21
|
processCachedTask
|
|
21
22
|
} from "./chunk-RRHPTTCP.mjs";
|
|
22
23
|
import {
|
|
23
24
|
setupPatchRecorder
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FQX7YIN5.mjs";
|
|
25
26
|
import {
|
|
26
27
|
collectRuntimeClassSet,
|
|
27
28
|
createDebug,
|
|
28
29
|
getCompilerContext,
|
|
29
30
|
pluginName,
|
|
30
31
|
refreshTailwindRuntimeState
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-QYYQDG6A.mjs";
|
|
32
33
|
import "./chunk-3VIPMWAG.mjs";
|
|
33
34
|
import "./chunk-QF65JGNW.mjs";
|
|
34
35
|
import {
|
|
@@ -68,11 +69,9 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
68
69
|
twPatcher: initialTwPatcher,
|
|
69
70
|
refreshTailwindcssPatcher
|
|
70
71
|
} = this.options;
|
|
71
|
-
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
72
|
+
const disabledOptions = resolveDisabledOptions(disabled);
|
|
74
73
|
const isTailwindcssV4 = (initialTwPatcher.majorVersion ?? 0) >= 4;
|
|
75
|
-
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false;
|
|
74
|
+
const shouldRewriteCssImports = isTailwindcssV4 && this.options.rewriteCssImports !== false && !disabledOptions.rewriteCssImports;
|
|
76
75
|
const isMpxApp = isMpx(this.appType);
|
|
77
76
|
if (shouldRewriteCssImports) {
|
|
78
77
|
applyTailwindcssCssImportRewrite(compiler, {
|
|
@@ -82,6 +81,9 @@ var UnifiedWebpackPluginV4 = class {
|
|
|
82
81
|
});
|
|
83
82
|
setupMpxTailwindcssRedirect(weappTailwindcssPackageDir, isMpxApp);
|
|
84
83
|
}
|
|
84
|
+
if (disabledOptions.plugin) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
85
87
|
const patchRecorderState = setupPatchRecorder(initialTwPatcher, this.options.tailwindcssBasedir, {
|
|
86
88
|
source: "runtime",
|
|
87
89
|
cwd: this.options.tailwindcssBasedir ?? process.cwd()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-tailwindcss",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.15",
|
|
4
4
|
"description": "把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -184,9 +184,9 @@
|
|
|
184
184
|
"tailwindcss-patch": "^8.5.0",
|
|
185
185
|
"webpack-sources": "3.3.3",
|
|
186
186
|
"yaml": "^2.8.2",
|
|
187
|
+
"@weapp-tailwindcss/shared": "1.1.1",
|
|
187
188
|
"@weapp-tailwindcss/logger": "1.1.0",
|
|
188
|
-
"@weapp-tailwindcss/postcss": "2.1.0"
|
|
189
|
-
"@weapp-tailwindcss/shared": "1.1.1"
|
|
189
|
+
"@weapp-tailwindcss/postcss": "2.1.0"
|
|
190
190
|
},
|
|
191
191
|
"scripts": {
|
|
192
192
|
"dev": "tsup --watch --sourcemap",
|
package/dist/chunk-BYXBJQAS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|